[go: up one dir, main page]

login
A268176
a(0) = a(1) = 1, and a(n) = a(n-1) + a( (a(n-1)-1) mod n ) for n>=2.
2
1, 1, 2, 3, 5, 10, 13, 23, 36, 72, 73, 86, 87, 123, 196, 197, 202, 398, 399, 798, 1196, 1994, 2117, 2118, 2128, 2130, 4248, 4284, 8568, 8655, 8851, 9048, 11166, 11252, 20300, 40600, 44884, 44886, 44909, 45707, 49955, 50157, 50193, 50279, 59130, 118260, 163967
OFFSET
0,3
LINKS
N. J. A. Sloane, Open Problems in the OEIS, Slides of Guest Lecture given in Doron Zeilberger's Experimental Mathematics Class, Rutgers University, May 2, 2016.
MAPLE
a:= proc(n) option remember; `if`(n<2, 1,
a(n-1)+a(irem((a(n-1)-1), n)))
end:
seq(a(n), n=0..50); # Alois P. Heinz, Apr 08 2016
MATHEMATICA
a[0] = a[1] = 1; a[n_] := a[n] = # + a@ Mod[# - 1, n] &@ a[n - 1]; Array[a, 47, 0] (* Michael De Vlieger, Apr 08 2016 *)
PROG
(PARI) lista(nn) = {va = vector(nn); print1(va[1] = 1, ", "); print1(va[2] = 1, ", "); for (n=3, nn, va[n] = va[n-1] + va[((va[n-1]-1) % (n-1))+1]; print1(va[n], ", "); ); } \\ Michel Marcus, Apr 08 2016
(Python)
from sympy.core.cache import cacheit
@cacheit
def a(n): return 1 if n<2 else a(n - 1) + a((a(n - 1) - 1)%n)
print([a(n) for n in range(51)]) # Indranil Ghosh, Aug 06 2017
CROSSREFS
Cf. A125204.
Sequence in context: A186082 A103746 A071848 * A120938 A120610 A090859
KEYWORD
nonn,easy
AUTHOR
Christian Perfect, Jan 28 2016
STATUS
approved