OFFSET
0,3
MATHEMATICA
a[0] = 1; a[n_] := a[n] = If[a[n - 1] > n - 1, 1, a[n - 1] + a[a[n - 1]]]; Array[a, 80, 0] (* Amiram Eldar, Dec 06 2022 *)
PROG
(Python)
from functools import cache
@cache
def a(n): return 1 if n==0 else (1 if a(n-1) > n-1 else a(n-1) + a(a(n-1)))
print([a(n) for n in range(76)]) # Michael S. Branicky, Nov 15 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Aidan Clarke, Nov 15 2022
STATUS
approved