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

A284520
a(1) = 1, a(2) = a(3) = a(4) = 2; a(n) = a(a(n-1)-1) + a(n-a(n-3)-1) for n > 4.
1
1, 2, 2, 2, 3, 4, 4, 4, 4, 5, 6, 7, 8, 8, 8, 8, 8, 8, 9, 10, 11, 12, 13, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 17, 18, 19, 19, 19, 19, 20, 22, 25, 28, 28, 26, 24, 23, 25, 29, 30, 31, 30, 30, 30, 31, 31, 31, 31, 32, 32, 32, 32, 32, 32, 32, 32, 33, 34, 35, 35, 35
OFFSET
1,2
EXAMPLE
a(5) = 3 because a(5) = a(a(4)-1) + a(5-a(2)-1) = a(1) + a(2) = 3.
PROG
(PARI) a=vector(1000); a[1]=1; a[2]=a[3]=a[4]=2; for(n=5, #a, a[n]=a[a[n-1]-1]+ a[n-a[n-3]-1]); a
KEYWORD
nonn,look
AUTHOR
Altug Alkan, Mar 28 2017
STATUS
approved