OFFSET
1,4
COMMENTS
Superseeker suggested that this sequence might be related to A096534 via the transformation T026 (coefficients of Sn(z)/(1+z)) for a(3) to a(76). - Eli Jaffe, Sep 16 2015
Superseeker's reply seems to be true: it appears that the present sequence has generating function equal to (1+x)*(1+x*G(X)), where G(x) is the g.f. for A096534. - N. J. A. Sloane, Nov 23 2015
LINKS
Danny Rorabaugh, Table of n, a(n) for n = 1..10000
FORMULA
a(n) < 2n.
A096534(n) == a(n) mod n. - Danny Rorabaugh, Oct 13 2015
EXAMPLE
For n=8, a(8) = (a(7) mod 7) + (a(6) mod 6) = 1 + 5 = 6. - Eli Jaffe, Sep 16 2015
MAPLE
a:= proc(n) option remember; `if`(n<3, 1,
add(irem(a(n-j), n-j), j=1..2))
end:
seq(a(n), n=1..100); # Alois P. Heinz, Mar 20 2018
MATHEMATICA
a = {1, 1}; Do[AppendTo[a, Mod[a[[n - 1]], n - 1] + Mod[a[[n - 2]], n - 2]], {n, 3, 76}]; a (* Michael De Vlieger, Sep 17 2015 *)
RecurrenceTable[{a[1]==a[2]==1, a[n]==Mod[a[n-1], n-1]+Mod[a[n-2], n-2]}, a, {n, 80}] (* Harvey P. Dale, Oct 28 2017 *)
PROG
(Magma) I:=[1, 1]; [n le 2 select I[n] else Self(n-1) mod (n-1) + Self(n-2) mod (n-2): n in [1..80]]; // Vincenzo Librandi, Sep 26 2015
(PARI) a=vector(10^5); a[1]=a[2]=1; for(n=3, #a, a[n]=a[n-1]%(n-1)+a[n-2]%(n-2)); a \\ Altug Alkan, Mar 20 2018
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Benoit Cloitre, Aug 14 2002
EXTENSIONS
Corrected by Harvey P. Dale, Oct 28 2017
STATUS
approved