|
|
A050029
|
|
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) = 1 and a(3) = 2.
|
|
14
|
|
|
1, 1, 2, 3, 4, 7, 9, 10, 11, 21, 30, 37, 41, 44, 46, 47, 48, 95, 141, 185, 226, 263, 293, 314, 325, 335, 344, 351, 355, 358, 360, 361, 362, 723, 1083, 1441, 1796, 2147, 2491, 2826, 3151, 3465, 3758, 4021, 4247, 4432, 4573, 4668, 4716
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
LINKS
|
|
|
FORMULA
|
a(n) = a(2^ceiling(log_2(n-1)) + 2 - n) + a(n-1) for n >= 4.
a(n) = a(n - 1 - A006257(n-2)) + a(n-1) for n >= 4. (End)
|
|
MAPLE
|
a := proc(n) option remember;
`if`(n < 4, [1, 1, 2][n], a(n - 1) + a(Bits:-Iff((n - 2) $ 2) + 3 - n));
end proc;
|
|
MATHEMATICA
|
Fold[Append[#1, #1[[-1]] + #1[[#2]]] &, {1, 1, 2}, Flatten@Table[k, {n, 5}, {k, 2^n, 1, -1}]] (* Ivan Neretin, Sep 06 2015 *)
|
|
CROSSREFS
|
Cf. A006257, A050025 (similar, but with different initial conditions).
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|