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.
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
Keywords
Links
- Ivan Neretin, Table of n, a(n) for n = 1..8193
Crossrefs
Programs
-
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 *)
Extensions
Name edited by Petros Hadjicostas, Nov 18 2019