|
Search: id:A072219
|
|
|
| A072219 |
|
Any number n can be written uniquely in the form n = 2^k_1 - 2^k_2 + 2^k_3 - ... + 2^k_{2r+1} where the signs alternate, there are an odd number of terms and k_1 > k_2 > k_3 > ... >k_{2r+1} >= 0; sequence gives number of terms 2r+1. |
|
+0 5
|
|
| 1, 1, 3, 1, 3, 3, 3, 1, 3, 3, 5, 3, 3, 3, 3, 1, 3, 3, 5, 3, 5, 5, 5, 3, 3, 3, 5, 3, 3, 3, 3, 1, 3, 3, 5, 3, 5, 5, 5, 3, 5, 5, 7, 5, 5, 5, 5, 3, 3, 3, 5, 3, 5, 5, 5, 3, 3, 3, 5, 3, 3, 3, 3, 1, 3, 3, 5, 3, 5, 5, 5, 3, 5, 5, 7, 5, 5, 5, 5, 3, 5, 5, 7, 5, 7, 7, 7, 5, 5, 5, 7, 5, 5, 5, 5, 3, 3, 3, 5, 3, 5, 5, 5, 3, 5
(list; graph; listen)
|
|
|
OFFSET
|
1,3
|
|
|
COMMENT
|
2^k_1 is smallest power of 2 that is >= n.
The Mathematica program computes the sequence for numbers 1 to 2^m. - T. D. Noe (noe(AT)sspectra.com), Jul 15 2002
|
|
REFERENCES
|
P. Bachmann, Niedere Zahlentheorie (1902, 1910), reprinted Chelsea, NY, 1968, vol. 2, pp. 61-62.
|
|
EXAMPLE
|
1=1, 2=2, 3=4-2+1, 4=4, 5=8-4+1, 6=8-4+2, ...
|
|
MATHEMATICA
|
Needs["DiscreteMath`Combinatorica`"]; sumit[s_List] := Module[{i, ss=0}, Do[If[OddQ[i], ss+=s[[i]], ss-=s[[i]]], {i, Length[s]}]; ss]; m=8; powers=Table[2^i, {i, 0, m}]; lst=Table[0, {2^m}]; sets={}; Do[sets=Union[sets, KSubsets[powers, i]], {i, 1, m+1, 2}]; Do[t=sets[[i]]; lst[[sumit[t]]]=Length[t], {i, Length[sets]}]; lst
|
|
CROSSREFS
|
Cf. A072339, A065621.
Equals 2*A033264(n-1) + 1.
Adjacent sequences: A072216 A072217 A072218 this_sequence A072220 A072221 A072222
Sequence in context: A081325 A132680 A105595 this_sequence A059789 A023136 A068074
|
|
KEYWORD
|
nonn,easy,nice
|
|
AUTHOR
|
njas, Jul 05 2002
|
|
EXTENSIONS
|
More terms from T. D. Noe (noe(AT)sspectra.com), Jul 15 2002
|
|
|
Search completed in 0.002 seconds
|