OFFSET
1,2
COMMENTS
You have n pebbles arranged in several piles. At each turn you take one pebble from each pile and put them into a new pile.
For example, if you start with one pile of 6, at the next step there are two piles: {1,5}, then {2,4}, and so on. Eventually the sequence of partitions will repeat.
Here a(n) is the maximal number of steps before a repeat among all starting partitions.
LINKS
Jorgen Brandt, Cycles of Partitions, Proc. AMS, Vol. 85, No. 3 (July, 1982), pp. 483-486
Tanya Khovanova and others, Postings to the Sequence Fans Mailing List, circa Nov 18 2009
EXAMPLE
For example, for n = 6, the worst case is {2,2,1,1}, and the steps are: {2, 2, 1, 1}, {1, 1, 4}, {3, 3}, {2, 2, 2}, {1, 1, 1, 3}, {2, 4}, {1, 2, 3}, {1, 2, 3}, {1, 2, 3}, {1, 2, 3}, {1, 2, 3}. Hence a(6) = 7.
MATHEMATICA
In[33]:= << Combinatorica`
step[list_] := Sort[Select[Prepend[list - 1, Length[list]], # > 0 &]]
cycleStart[list_] := (res = 1; sofar = {list}; current = list;
nextStep = Nest[step, current, 1];
While[! MemberQ[sofar, nextStep], res++; current = nextStep;
nextStep = Nest[step, current, 1]; sofar = Append[sofar, current]];
res)
Table[Max[Map[cycleStart, Partitions[n]]], {n, 30}]
Out[36]= {1, 2, 3, 5, 6, 7, 8, 9, 11, 13, 13, 13, 14, 19, 21, 21, 18, 19, 22, 29, 31, 31, 25, 25, 26, 33, 41, 43, 43, 36}
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Nov 27 2011
STATUS
approved