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

A050046
a(n) = a(n-1) + a(m) for n >= 4, where m = n - 1 - 2^p and p is the unique integer such that 2^p < n - 1 <= 2^(p+1), starting with a(1) = 1 and a(2) = a(3) = 2.
4
1, 2, 2, 3, 5, 6, 8, 10, 13, 14, 16, 18, 21, 26, 32, 40, 50, 51, 53, 55, 58, 63, 69, 77, 87, 100, 114, 130, 148, 169, 195, 227, 267, 268, 270, 272, 275, 280, 286, 294, 304, 317, 331, 347, 365, 386, 412, 444
OFFSET
1,2
LINKS
MAPLE
a := proc(n) option remember;
`if`(n < 4, [1, 2, 2][n], a(n - 1) + a(-2^ceil(-1+log[2](n - 1)) + n - 1)):
end proc:
seq(a(n), n = 1..40); # Petros Hadjicostas, Apr 23 2020
MATHEMATICA
Fold[Append[#1, #1[[-1]] + #1[[#2]]] &, {1, 2, 2}, Flatten@Table[k, {n, 5}, {k, 2^n}]] (* Ivan Neretin, Sep 08 2015 *)
CROSSREFS
Cf. similar sequences listed in A050034.
Sequence in context: A060966 A135279 A035631 * A052337 A308858 A192432
KEYWORD
nonn
EXTENSIONS
Name edited by Petros Hadjicostas, Apr 23 2020
STATUS
approved