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

A059964
a(1) = 1, a(2) = 1, a(n) = a(n-p) + a((n+1)-p), n > 2, where p is the largest prime less than n.
0
1, 1, 2, 2, 3, 2, 3, 2, 3, 4, 5, 2, 3, 2, 3, 4, 5, 2, 3, 2, 3, 4, 5, 2, 3, 4, 5, 5, 5, 2, 3, 2, 3, 4, 5, 5, 5, 2, 3, 4, 5, 2, 3, 2, 3, 4, 5, 2, 3, 4, 5, 5, 5, 2, 3, 4, 5, 5, 5, 2, 3, 2, 3, 4, 5, 5, 5, 2, 3, 4, 5, 2, 3, 2, 3, 4, 5, 5, 5, 2, 3, 4, 5, 2, 3, 4, 5, 5, 5, 2, 3, 4, 5, 5, 5, 5, 5, 2, 3, 4, 5, 2, 3, 2, 3
OFFSET
1,3
EXAMPLE
a(16) = a(16-13) + a(17-13) = a(3) + a(4) = 2 + 2 = 4.
MAPLE
with(numtheory): a := proc(n) option remember: if n <= 2 and n >=1 then RETURN(1) fi: a(n-prevprime(n))+ a(n+1-prevprime(n)): end: for n from 1 to 250 do printf(`%d, `, a(n)) od:
CROSSREFS
Sequence in context: A324901 A295568 A099427 * A308050 A248147 A087458
KEYWORD
nonn
AUTHOR
Brian Wallace (wallacebrianedward(AT)yahoo.co.uk), Mar 04 2001
EXTENSIONS
More terms from James A. Sellers, Mar 15 2001
STATUS
approved