|
|
A151787
|
|
a(1)=1; for n > 1, a(n)=3*2^{wt(n-1)-1}.
|
|
8
|
|
|
1, 3, 3, 6, 3, 6, 6, 12, 3, 6, 6, 12, 6, 12, 12, 24, 3, 6, 6, 12, 6, 12, 12, 24, 6, 12, 12, 24, 12, 24, 24, 48, 3, 6, 6, 12, 6, 12, 12, 24, 6, 12, 12, 24, 12, 24, 24, 48, 6, 12, 12, 24, 12, 24, 24, 48, 12, 24, 24, 48, 24, 48, 48, 96, 3, 6, 6, 12, 6, 12, 12, 24, 6, 12, 12, 24, 12, 24, 24, 48
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
wt(n) is the Hamming weight = binary weight of n (A000120).
|
|
LINKS
|
|
|
FORMULA
|
For n > 1, a(2*n)=2*a(n).
a(2*n+1)=a(n+1).
G.f. g(x) satisfies g(x) = (2+1/x)*g(x^2) + x^2. (End)
|
|
MAPLE
|
wt:= n -> convert(convert(n, base, 2), `+`):
[1, seq(3*2^(wt(n-1)-1), n=2..100)]; # Robert Israel, Feb 27 2018
|
|
MATHEMATICA
|
a[n_] := If[n == 1, 1, 3*2^(Total[IntegerDigits[n-1, 2]]-1)];
|
|
PROG
|
(PARI) a(n) = if (n==1, 1, 3*2^(hammingweight(n-1)-1)); \\ Michel Marcus, Feb 27 2018
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|