OFFSET
0,3
COMMENTS
Periodic with period 63584 starting at n = 441329.
LINKS
Jack Kiuttu, Table of n, a(n) for n = 0..10000
EXAMPLE
n = 8: a(7) = 7, a(6) = 9, so a(8) = a(a(7) mod 8) + a(a(6) mod 8) = a(7 mod 8) + a(9 mod 8) = a(7) + a(1) = 7 + 1 = 8.
MATHEMATICA
a[0] = a[1] = 1; a[n_] := a[n] = a[Mod[a[n-1], n]] + a[Mod[a[n-2], n]]; Array[a, 66, 0] (* Amiram Eldar, Dec 21 2019 *)
PROG
(Python 3) # Lists terms up to given n.
def a_list(n):
a=[1, 1]
for k in range(2, n+1):
a.append(a[a[-1]%k]+a[a[-2]%k])
return a
CROSSREFS
KEYWORD
nonn
AUTHOR
Jack Kiuttu, Dec 20 2019
STATUS
approved