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

A050025
a(n) = a(n-1) + a(m) for n >= 4, where m = 2^(p+1) + 2 - n and p is the unique integer such that 2^p < n - 1 <= 2^(p+1), starting with a(1) = a(2) = a(3) = 1.
12
1, 1, 1, 2, 3, 5, 6, 7, 8, 15, 21, 26, 29, 31, 32, 33, 34, 67, 99, 130, 159, 185, 206, 221, 229, 236, 242, 247, 250, 252, 253, 254, 255, 509, 762, 1014, 1264, 1511, 1753, 1989, 2218, 2439, 2645, 2830, 2989, 3119, 3218, 3285, 3319
OFFSET
1,4
LINKS
MAPLE
a := proc(n) option remember;
`if`(n < 4, 1, a(n - 1) + a(Bits:-Iff(n - 2, n - 2) + 3 - n)); end proc;
seq(a(n), n = 1 .. 48); # Petros Hadjicostas, Nov 08 2019
MATHEMATICA
Fold[Append[#1, #1[[-1]] + #1[[#2]]] &, {1, 1, 1}, Flatten@Table[k, {n, 5}, {k, 2^n, 1, -1}]] (* Ivan Neretin, Sep 06 2015 *)
PROG
(PARI) lista(nn) = {nn = max(nn, 3); my(va = vector(nn)); va[1] = 1; va[2] = 1; va[3] = 1; for(n=4, nn, va[n] = va[n-1] + va[2*2^logint(n-2, 2) + 2 - n]); va; } \\ Petros Hadjicostas, May 03 2020
CROSSREFS
Sequence in context: A197433 A153781 A255398 * A255430 A074492 A059307
KEYWORD
nonn
EXTENSIONS
Name edited by Petros Hadjicostas, Nov 08 2019
STATUS
approved