login
A050030
a(n) = a(n-1) + a(m) for n >= 3, 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) = a(2) = 1.
8
1, 1, 2, 3, 4, 5, 6, 8, 11, 12, 13, 15, 18, 22, 27, 33, 41, 42, 43, 45, 48, 52, 57, 63, 71, 82, 94, 107, 122, 140, 162, 189, 222, 223, 224, 226, 229, 233, 238, 244, 252, 263, 275, 288, 303, 321, 343, 370, 403
OFFSET
1,3
LINKS
MATHEMATICA
Fold[Append[#1, #1[[-1]] + #1[[#2]]] &, {1, 1}, Flatten@Table[k, {n, 0, 5}, {k, 2^n}]] (* Ivan Neretin, Sep 06 2015 *)
PROG
(PARI) lista(nn) = {nn = max(nn, 2); my(va = vector(nn)); va[1] = 1; va[2] = 1; for(n=3, nn, va[n] = va[n-1] + va[n - 1 - 2^logint(n-2, 2)]); va; } \\ Petros Hadjicostas, May 10 2020
CROSSREFS
Sequence in context: A229034 A265406 A096120 * A350097 A046889 A026267
KEYWORD
nonn
EXTENSIONS
Name edited by Petros Hadjicostas, May 10 2020
STATUS
approved