OFFSET
1,1
LINKS
Hiroaki Yamanouchi, Table of n, a(n) for n = 1..105
Popular Computing (Calabasas, CA), Contest 9, Vol. 4 (No. 40, July 1976), scanned copy of page PC40-1.
Popular Computing (Calabasas, CA), Contest 9, Vol. 4 (No. 40, July 1976), scanned copy of page PC40-3.
EXAMPLE
For n=1 we get the Fibonacci sequence (starting 1,1,2,3,...), A000045, which read mod 10 repeats with period 60 (see A003893), so a(1)=60. The full period in this case is:
[1, 1, 2, 3, 5, 8, 3, 1, 4, 5, 9, 4, 3, 7, 0, 7, 7, 4, 1, 5, 6, 1, 7, 8, 5, 3, 8, 1, 9, 0, 9, 9, 8, 7, 5, 2, 7, 9, 6, 5, 1, 6, 7, 3, 0, 3, 3, 6, 9, 5, 4, 9, 3, 2, 5, 7, 2, 9, 1, 0].
PROG
(Python)
from itertools import accumulate # requires python 3.2 or higher
def A256985(n):
....ilist, k = [1]*(n+1), 1
....jlist = [d % 10 for d in accumulate(ilist)]
....jlist = [jlist[-1]]+ jlist[:-1]
....while ilist != jlist:
........k += 1
........jlist = [d % 10 for d in accumulate(jlist)]
........jlist = [jlist[-1]]+ jlist[:-1]
....return k # Chai Wah Wu, Apr 30 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Apr 26 2015
EXTENSIONS
a(6)-a(11) from Chai Wah Wu, Apr 30 2015
a(12)-a(21) from Hiroaki Yamanouchi, May 04 2015
STATUS
approved