login
This site is supported by donations to The OEIS Foundation.
Logo

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A073122 Minimal reversing binary representation of n. Converting sum of powers of 2 in binary representation of a(n) to alternating sum gives n. See A072339. 2
1, 2, 5, 4, 13, 10, 9, 8, 25, 26, 29, 20, 21, 18, 17, 16, 49, 50, 53, 52, 61, 58, 57, 40, 41, 42, 45, 36, 37, 34, 33, 32, 97, 98, 101, 100, 109, 106, 105, 104, 121, 122, 125, 116, 117, 114, 113, 80, 81, 82, 85, 84, 93, 90, 89, 72, 73, 74, 77, 68, 69, 66, 65, 64, 193 (list; graph; refs; listen; history; internal format)
OFFSET

1,2

COMMENTS

The minimal representation is unique. The number of powers of 2 can be either even or odd. Compare with A065621, in which the number of powers of 2 is odd. The Mathematica program computes the representation for numbers 1 to 2^m. a(0) = 0.

REFERENCES

D. E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, 1981, Vol. 2 (Second Edition), p. 196, (exercise 4.1. Nr. 27)

FORMULA

a(2n) = a(n).

EXAMPLE

a(11) = 29 because 29 = 16 + 8 + 4 + 1 and 16 - 8 + 4 - 1 = 11.

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=7; powers=Table[2^i, {i, 0, m}]; lst=Table[2m, {2^m}]; lst2=Table[0, {2^m}]; Do[t=NthSubset[i, powers]; len=Length[t]; st=sumit[t]; If[len<lst[[st]], lst[[st]]=len; lst2[[st]]=Plus@@t], {i, 2^(m+1)-1}]; lst2

CROSSREFS

Cf. A065621, A072219, A072339.

Sequence in context: A126356 A121274 A111681 * A084410 A080067 A117824

Adjacent sequences:  A073119 A073120 A073121 * A073123 A073124 A073125

KEYWORD

easy,nice,nonn

AUTHOR

T. D. Noe (noe(AT)sspectra.com), Jul 17 2002

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified February 17 00:09 EST 2012. Contains 205978 sequences.