OFFSET
1,3
COMMENTS
{a(n)} is the Pinn F 1,0(n) sequence (see link section).
LINKS
K. Pinn, A Chaotic Cousin Of Conway's Recursive Sequence, arXiv:cond-mat/9808031 [cond-mat.stat-mech], 1998.
EXAMPLE
a(3)=2 because a(3) = a(3-1-a(3-1))+a(3-a(3-2)) = a(2-1)+a(3-1) = 1+1 = 2.
MATHEMATICA
a[1] = a[2] = 1; a[n_] := a[n] = a[n - 1 - a[n - 1]] + a[n - a[n - 2]]; Table[ a[n], {n, 1, 40}]
PROG
(Python3)
a=[1, 1]
for n in range(100):
i1=len(a)-1-a[len(a)-1]
i2=len(a)-a[len(a)-2]
if i1>=0 and i2>=0 :
a.append(a[i1]+a[i2])
else :
print("Sequence dies. Contains ", n+2, " terms.")
break
print(a)
(PARI) lista(nn) = {my(va = vector(nn)); va[1] = 1; va[2] = 1; for (n=3, nn, va[n]=va[n-1-va[n-1]]+va[n-va[n-2]]; ); va; } \\ Michel Marcus, Dec 07 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Pablo Hueso Merino, Dec 02 2020
STATUS
approved