OFFSET
1,2
COMMENTS
a(n+1) = number of Mancala numbers <= n, see A007952; n occurs A028913(n-1) times consecutively. - Reinhard Zumkeller, Jun 21 2008
LINKS
R. Zumkeller, Table of n, a(n) for n = 1..10000
FORMULA
Conjecture: a(n) = sqrt(Pi*n) + O(1)
a(n) = A073047(n) - 1.
EXAMPLE
If n=6 : s(0)=6, s(1)=6-6 mod 2=6, s(2)=6-6 mod 3=6, s(3)=6-6 mod 4=6-2=4, s(4)=4-4 mod 5=0, hence a(6)=4.
If s(0)=4, 4 ->4-4 mod 1=4 ->4-4 mod 2=4 ->4-4 mod 3=3 ->3-3 mod 4=0, hence s(4)=0 and a(4)=4.
MATHEMATICA
Flatten@Table[First@Position[Rest@FoldList[#1-Mod[#1, #2]&, i, Range[2, i+1]], 0], {i, 30}] (* Birkas Gyorgy, Feb 26 2011 *)
PROG
(PARI) a(n)=if(n<1, 0, s=n; c=1; while(s-s%c>0, s=s-s%c; c++); c)
CROSSREFS
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Apr 25 2003
STATUS
approved