Problem description:
Set set S is positive integers, S is a set of no and, if and only if x and y S, contains the x + y does not belong to S,
For any positive integer k, if can {1, 2,... } is divided into n, k and subsets S1, S2,... , Sn,
Said it was the whole k is divisible, n r F (n)=Max {k | k is divisible n},
Try to design an algorithm that for any given n, calculating the value of F (n),
Programming tasks:
For any given n, programming, calculating the value of F (n),
CodePudding user response:
The Integer [] Numbers={1, 2, 3};
Var list=Arrays. AsList (Numbers);
Var Max=Collections. Max (list);