The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A089048 Number of ways of writing n as a sum of exactly 3 powers of 2. 8
0, 0, 0, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 0, 1, 1, 2, 1, 2, 1, 1, 0, 2, 1, 1, 0, 1, 0, 0, 0, 1, 1, 2, 1, 2, 1, 1, 0, 2, 1, 1, 0, 1, 0, 0, 0, 2, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 1, 2, 1, 1, 0, 2, 1, 1, 0, 1, 0, 0, 0, 2, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 1, 1, 0, 1, 0, 0, 0, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,7
COMMENTS
The powers do not need to be distinct.
LINKS
FORMULA
For n > 2: a(n) = (1 + (1 - A000120(n) mod 2)*(1 - n mod 2)) * 0^floor(A000120(n)/4). - Reinhard Zumkeller, Dec 14 2003
MAPLE
f := proc(n, k) option remember; if k > n then RETURN(0); fi; if k= 0 then if n=0 then RETURN(1) else RETURN(0); fi; fi; if n mod 2 = 1 then RETURN(f(n-1, k-1)); fi; f(n-1, k-1)+f(n/2, k); end; # present sequence is f(n, 3)
MATHEMATICA
a[n_] := If[n < 3, 0, ((1 - Mod[n, 2])*(1 - Mod[DigitCount[n, 2, 1], 2]) + 1)*If[Floor[(1/4)*DigitCount[n, 2, 1]] == 0, 1, 0]];
Table[a[n], {n, 0, 104}] (* Jean-François Alcover, Feb 13 2018, after Reinhard Zumkeller *)
CROSSREFS
A column of A089052.
Sequence in context: A305054 A238097 A066955 * A329443 A348416 A263025
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Dec 03 2003
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 13 17:28 EDT 2024. Contains 372522 sequences. (Running on oeis4.)