OFFSET
1,2
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
Hsien-Kuei Hwang, Svante Janson, and Tsung-Hsi Tsai, Identities and periodic oscillations of divide-and-conquer recurrences splitting at half, arXiv:2210.10968 [cs.DS], 2022, p. 30.
FORMULA
G.f. g(x) satisfies g(x) = (2+1/x)*(1+x)*g(x^2) + x^2/(1-x). - Robert Israel, Feb 27 2018
MAPLE
wt:= n -> convert(convert(n, base, 2), `+`):
ListTools:-PartialSums([1, seq(3*2^(wt(n-1)-1), n=2..100)]); # Robert Israel, Feb 27 2018
MATHEMATICA
b[n_] := If[n == 1, 1, 3*2^(Total[IntegerDigits[n-1, 2]]-1)];
Array[b, 100] // Accumulate (* Jean-François Alcover, Mar 27 2019 *)
PROG
(PARI) b(n) = if (n==1, 1, 3*2^(hammingweight(n-1)-1));
a(n) = sum(k=1, n, b(k)); \\ Michel Marcus, Feb 27 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Jun 25 2009
STATUS
approved