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”).

A287155
a(1) = 1 by convention. a(2) = a(3) = a(4) = 2; a(n) = a(a(n-1)) + a(n-a(n-1)) for n > 4.
1
1, 2, 2, 2, 4, 4, 4, 4, 6, 6, 8, 6, 8, 8, 8, 8, 10, 10, 12, 10, 14, 12, 14, 14, 16, 14, 16, 14, 16, 16, 16, 16, 18, 18, 20, 18, 22, 20, 22, 22, 24, 24, 26, 24, 28, 24, 28, 24, 30, 26, 30, 28, 30, 30, 32, 30, 32, 30, 32, 30, 32, 32, 32, 32, 34, 34, 36, 34, 38, 36, 38, 38, 40, 40
OFFSET
1,2
MATHEMATICA
a[1] = 1; a[2] = a[3] = a[4] = 2; a[n_] := a[n] = a[a[n - 1]] + a[n - a[n - 1]]; Array[a, 74] (* Michael De Vlieger, May 20 2017 *)
PROG
(PARI) q=vector(10000); q[1]=1; q[2]=q[3]=q[4]=2; for(n=5, #q, q[n]=q[q[n-1]]+q[n-q[n-1]]); vector(10000, n, q[n])
CROSSREFS
Cf. A004001.
Sequence in context: A317841 A007614 A289256 * A287654 A355911 A369207
KEYWORD
nonn
AUTHOR
Altug Alkan, May 20 2017
STATUS
approved