OFFSET
1,1
LINKS
FORMULA
a(n) <= (n+1)^n.
EXAMPLE
For n=3, the possible subtraction sets are {1,2,3}, {2,3}, {1,3}, {3}. We can calculate that the {1,2,3} set has period 4 (0, 1, 2, 3), {2,3} has period 5 (0, 0, 1, 1, 2), {1,3} has period 2 (0, 1) and {3} has period 6 (0, 0, 0, 1, 1, 1) so the largest possible one is 6.
The eventual in the name means that the sequence may not be period at the first term. For example, if the subtraction set is {1,4,10} then the SG value sequence is 0, 1, 0, 1, 2, 0, 1, 0, 1, 2, 3, 2, 3, 0, 1, 3, (0, 1, 0, 1, 2, 0, 1, 2, 0, 1, 2).
MATHEMATICA
mex[list_] := Module[{m = 0}, While[MemberQ[list, m], m++]; m];
SGList[s_List, n_] :=
Module[{sg = Array[0 &, n + 1], i},
For[i = 2, i <= n + 1, i++,
sg[[i]] = mex@sg[[Select[i - s, # >= 1 &]]]; ];
sg]
possibleperiod[s_List] := Length[FindTransientRepeat[s, 2][[2]]]
A[n_] :=
Max@Table[
possibleperiod[
SGList[s, 10*n^3]], {s, (Union[#, {n}] &) /@
Subsets[Range[n - 1]]}]
PROG
(Python) # See Links.
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Rui Yao, Oct 10 2025
STATUS
approved
