A096535 a(0) = a(1) = 1; a(n) = (a(n-1) + a(n-2)) mod n.
1, 1, 0, 1, 1, 2, 3, 5, 0, 5, 5, 10, 3, 0, 3, 3, 6, 9, 15, 5, 0, 5, 5, 10, 15, 0, 15, 15, 2, 17, 19, 5, 24, 29, 19, 13, 32, 8, 2, 10, 12, 22, 34, 13, 3, 16, 19, 35, 6, 41, 47, 37, 32, 16, 48, 9, 1, 10, 11, 21, 32, 53, 23, 13, 36, 49, 19, 1, 20, 21, 41, 62, 31, 20, 51, 71, 46, 40, 8, 48, 56
Offset: 0
Links
- T. D. Noe, Table of n, a(n) for n = 0..10000
Programs
-
Haskell
a096535 n = a096535_list !! n a096535_list = 1 : 1 : f 2 1 1 where f n x x' = y : f (n+1) y x where y = mod (x + x') n -- Reinhard Zumkeller, Oct 19 2011
-
Mathematica
l = {1, 1}; For[i = 2, i <= 100, i++, len = Length[l]; l = Append[l, Mod[l[[len]] + l[[len - 1]], i]]]; l f[s_] := f[s] = Append[s, Mod[s[[ -2]] + s[[ -1]], Length[s]]]; Nest[f, {1, 1}, 80] (* Robert G. Wilson v, Aug 29 2006 *) RecurrenceTable[{a[0]==a[1]==1,a[n]==Mod[a[n-1]+a[n-2],n]},a,{n,90}] (* Harvey P. Dale, Apr 12 2013 *)
Comments