OFFSET
1,6
COMMENTS
Performing the modulus operation, the smallest nonnegative residue is to be taken.
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
EXAMPLE
a(8) = (a(7) + a(6)) mod (8 - a(7)) = (2+3) mod (8-3) = 5 mod 5 = 0.
MATHEMATICA
a[1]=1; a[2]=1; a[n_] := a[n] = Mod[a[n-1] + a[n-2], n - a[n-1]]; Array[a, 74] (* Giovanni Resta, Jun 08 2013 *)
nxt[{n_, a_, b_}] := {n + 1, b, Mod[a + b, n + 1 - b]}; NestList[nxt, {2, 1, 1}, 80][[All, 2]] (* Harvey P. Dale, Mar 14 2020 *)
PROG
(Haskell)
a224909 n = a224909_list !! (n-1)
a224909_list = 1 : 1 : zipWith mod
(zipWith (+) a224909_list $ tail a224909_list)
(zipWith (-) [3..] $ tail a224909_list)
-- Reinhard Zumkeller, Jun 09 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
David S. Newman, Apr 19 2013
EXTENSIONS
a(31)-a(74) from Giovanni Resta, Jun 08 2013
STATUS
approved