|
|
A215675
|
|
a(1) = 1, a(n) = 2 if 1<n<=3, a(2n+1) = a(n)+1, a(2n+2) = a(n)+a(n+1)+1 otherwise.
|
|
4
|
|
|
1, 2, 2, 4, 3, 5, 3, 7, 5, 8, 4, 9, 6, 9, 4, 11, 8, 13, 6, 14, 9, 13, 5, 14, 10, 16, 7, 16, 10, 14, 5, 16, 12, 20, 9, 22, 14, 20, 7, 21, 15, 24, 10, 23, 14, 19, 6, 20, 15, 25, 11, 27, 17, 24, 8, 24, 17, 27, 11, 25, 15, 20, 6, 22, 17, 29, 13, 33, 21, 30, 10
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
In the S.-H. Cha reference this is function ~fog_2(n).
|
|
LINKS
|
|
|
FORMULA
|
G.f. A(x) satisfies: A(x) = x/(1 - x) + (1 + x + x^2) * A(x^2). - Ilya Gutkovskiy, May 23 2020
|
|
MAPLE
|
a:= proc(n) option remember; 1+ `if`(n=1, 0, `if`(n<=3, 1,
`if`(irem(n-1, 2, 'r')=0, a(r), a(r)+a(r+1))))
end:
|
|
MATHEMATICA
|
a[n_] := a[n] = If[n < 3, n, {q, r} = QuotientRemainder[n, 2];
Switch[r, 1, a[q] + 1, 0, a[q-1] + a[q] + 1]];
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|