OFFSET
1,1
LINKS
MATHEMATICA
a[n_] := a[n] = If[n <= 3, 2, a[n - a[n - 1]] + a[n - a[n - 3] - 1]]; Array[a, 82] (* Michael De Vlieger, Jun 30 2017 *)
PROG
(PARI) q=vector(10^5); q[1]=q[2]=q[3]=2; for(n=4, #q, q[n] = q[n-q[n-1]]+q[n-1-q[n-3]]); q
(Python)
l=[0, 2, 2, 2]
for n in range(4, 101): l+=[l[n - l[n - 1]] + l[n - l[n - 3] - 1], ]
print(l[1:]) # Indranil Ghosh, Jul 01 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Altug Alkan, Jun 29 2017
STATUS
approved