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

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A080079 Least number causing the longest carry sequence when adding numbers <= n to n in binary representation. 6
1, 2, 1, 4, 3, 2, 1, 8, 7, 6, 5, 4, 3, 2, 1, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47 (list; graph; refs; listen; history; internal format)
OFFSET

1,2

COMMENTS

T(n,k)<T(n,a(n))=A070940(n) for 1<=k<a(n) and T(n,k)<=T(n,a(n)) for a(n)<=k<=n, where T is defined as in A080080.

a(n) = n iff n=2^k, a(n) = A035327(n-1) otherwise. Equals A062383(n)-n. - Ralf Stephan, Jun 02 2003

FORMULA

a(n)=A004755(n)-2n; a(n)=-n+2*2^floor(log(n)/log(2)). - Benoit Cloitre, Feb 22 2003

a(0) = 0, a(2n) = 2a(n), a(2n+1) = 2a(n)-1+2[n==0]. - Ralf Stephan (ralf(AT)ark.in-berlin.de), Jan 04 2004

MATHEMATICA

Flatten@Table[Nest[Most[RotateRight[#]] &, Range[n], n - 1], {n, 30}] (Gyorgy Birkas)

Table[FromDigits[(IntegerDigits[n, 2] /. {0 -> 1, 1 -> 0}), 2] +

  1, {n, 30}] (Gyorgy Birkas)

Table[BitXor[n, 2^IntegerPart[Log[2, n] + 1] - 1] + 1, {n, 30}] (Gyorgy Birkas)

Table[2 2^Floor[Log[2, n]] - n, {n, 30}] (Gyorgy Birkas)

Flatten@Table[Reverse@Range[2^n], {n, 0, 4}] (Gyorgy Birkas)

CROSSREFS

Sequence in context: A109977 A201199 A175702 * A183201 A082467 A106407

Adjacent sequences:  A080076 A080077 A080078 * A080080 A080081 A080082

KEYWORD

nonn

AUTHOR

Reinhard Zumkeller (reinhard.zumkeller(AT)gmail.com), Jan 26 2003

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 14 23:53 EST 2012. Contains 205689 sequences.