login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A285578
a(1) = a(3) = a(4) = 2, a(2) = 1; a(n) = a(a(n-2)) + a(n-a(n-4)-2) for n > 4.
1
2, 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 6, 7, 7, 8, 8, 8, 8, 8, 9, 9, 10, 11, 12, 12, 13, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 17, 17, 18, 19, 19, 20, 20, 21, 21, 21, 22, 22, 23, 24, 25, 27, 27, 28, 28, 28, 29, 29, 30, 31, 31, 32, 32, 32, 32, 32, 32, 32, 32, 32, 33, 33, 34, 35
OFFSET
1,1
MATHEMATICA
a[1] = a[3] = a[4] = 2; a[2] = 1; a[n_] := a[n] = a[a[n - 2]] + a[n - a[n - 4] - 2]; Array[a, 75] (* Michael De Vlieger, Apr 24 2017 *)
PROG
(PARI) q=vector(10000); q[1]=q[3]=q[4]=2; q[2]=1; for(n=5, #q, q[n]=q[q[n-2]]+q[n-q[n-4]-2]); vector(10000, n, q[n])
CROSSREFS
Sequence in context: A224931 A029195 A242745 * A029168 A035454 A161228
KEYWORD
nonn
AUTHOR
Altug Alkan, Apr 22 2017
STATUS
approved