login
A050051
a(n) = a(n-1) + a(m) for n >= 4, where m = 2*n - 2 - 2^(p+1) and p is the unique integer such that 2^p < n - 1 <= 2^(p+1), starting with a(1) = 1, a(2) = 2, and a(3) = 3.
12
1, 2, 3, 5, 10, 12, 17, 29, 58, 60, 65, 77, 106, 166, 243, 409, 818, 820, 825, 837, 866, 926, 1003, 1169, 1578, 2398, 3235, 4161, 5330, 7728, 11889, 19617, 39234, 39236, 39241, 39253, 39282, 39342, 39419, 39585, 39994, 40814
OFFSET
1,2
LINKS
MAPLE
a := proc(n) option remember;
`if`(n < 4, [1, 2, 3][n], a(n - 1) + a(-2^ceil(log[2](n - 1)) + 2*n - 2)):
end proc:
seq(a(n), n = 1..40); # Petros Hadjicostas, Nov 18 2019
MATHEMATICA
Fold[Append[#1, #1[[-1]] + #1[[#2]]] &, {1, 2, 3}, Flatten@Table[2 k, {n, 5}, {k, 2^n}]] (* Ivan Neretin, Sep 06 2015 *)
CROSSREFS
Cf. A050027, A050031, A050035, A050039, A050043, A050047, A050055, A050059, A050063, A050067, A050071 (similar, but with different initial conditions).
Sequence in context: A182402 A079251 A171785 * A252353 A241167 A083571
KEYWORD
nonn
EXTENSIONS
Name edited by Petros Hadjicostas, Nov 18 2019
STATUS
approved