OFFSET
2,3
COMMENTS
a(n) = A147582(n)/4.
LINKS
Omar E. Pol, Illustration of initial terms (Overlapping squares) [From Omar E. Pol, Nov 15 2009]
FORMULA
a(n) = 3^A048881(n-2). - R. J. Mathar, Apr 30 2009
Recurrence: Write n = 2^i + 1 + j, 0 <= j < 2^i. Then a(2^i+1) = 1; for j>0, a(2^i+j+1) = 3*a(j+1). - N. J. A. Sloane, Jun 09 2009
G.f.: x*(Product_{k>=0} (1 + 3*x^(2^k)) - 1)/3. - N. J. A. Sloane, Jun 10 2009
EXAMPLE
MAPLE
MATHEMATICA
a[n_] := 3^(DigitCount[n - 1, 2, 1] - 1);
a /@ Range[2, 100] (* Jean-François Alcover, Mar 24 2020 *)
PROG
(PARI) a(n) = 3^(hammingweight(n-1)-1); \\ Michel Marcus, Mar 24 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Apr 29 2009
EXTENSIONS
Extended by R. J. Mathar, Apr 30 2009
Offset corrected by N. J. A. Sloane, Jun 09 2009
Further edited by N. J. A. Sloane, Aug 06 2009
STATUS
approved