OFFSET
1,2
LINKS
Andrew Howroyd, Table of n, a(n) for n = 1..1024
FORMULA
a(2^k) = 4*a(2^(k-1)) - 2*a(2^(k-2));
a(2^k) = round((1/2)*(2+sqrt(2))^k).
Multiplicative with a(2^e) = A006012(e), a(p^e) = 1 for odd prime p. - Andrew Howroyd, Jul 31 2018
MATHEMATICA
a[n_] := With[{e = IntegerExponent[n, 2]}, Sum[Binomial[e, 2k] 2^(e-k), {k, 0, Quotient[e, 2]}]];
a /@ Range[1, 100] (* Jean-François Alcover, Sep 20 2019, from PARI *)
PROG
(PARI) a(n)={my(e=valuation(n, 2)); sum(k=0, e\2, binomial(e, 2*k)*2^(e-k))} \\ Andrew Howroyd, Jul 31 2018
CROSSREFS
KEYWORD
nonn,mult
AUTHOR
Benoit Cloitre, Apr 14 2003
STATUS
approved