Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A035327
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A035327 Write n in binary, interchange 0's and 1's. +0
14
1, 0, 1, 0, 3, 2, 1, 0, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 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, 0, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46 (list; graph; listen)
OFFSET

0,5

COMMENT

Also bitwise XOR of n with the nearest Mersenne number (A000225) larger than or equal to n, for n > 0. (For n = 0, a(0) = -1 as opposed to 1). The advantage of using BitXor instead of BaseForm in the Mathematica program is that the result has a Head of Integer, not BaseForm. - Alonso Delarte (alonso.delarte(AT)gmail.com), Jan 14 2006

For n>0: largest m<=n such that no carry occurs when adding m to n in binary arithmetic: A003817(n+1) = a(n) + n = a(n) XOR n. [From Reinhard Zumkeller (reinhard.zumkeller(AT)gmail.com), Nov 14 2009]

REFERENCES

J.-P. Allouche and J. Shallit, The ring of k-regular sequences, II, Theoret. Computer Sci., 307 (2003), 3-29.

LINKS

R. Zumkeller, Table of n, a(n) for n = 0..10000 [From Reinhard Zumkeller (reinhard.zumkeller(AT)gmail.com), Nov 14 2009]

J.-P. Allouche and J. Shallit, The Ring of k-regular Sequences, II

R. Stephan, Divide-and-conquer generating functions. I. Elementary sequences

R. Stephan, Some divide-and-conquer sequences ...

R. Stephan, Table of generating functions

FORMULA

a(n) = 2^k - n - 1, where 2^(k-1) < n < 2^k.

a(n+1) = (a(n)+n) mod (n+1); a(0) = 1. - Reinhard Zumkeller (reinhard.zumkeller(AT)gmail.com), Jul 22 2002

G.f.: 1 + 1/(1-x)*sum(k>=0, 2^k*x^2^(k+1)/(1+x^2^k)). - Ralf Stephan, May 06 2003

a(0) = 0, a(2n+1) = 2*a(n), a(2n) = 2*a(n) + 1 . - DELEHAM Philippe (kolotoko(AT)wanadoo.fr), Feb 29 2004

a(n) = number of positive integers k < n such that n XOR k > n. a(n) = n - A006257(n). - Paul D. Hanna (pauldhanna(AT)juno.com), Jan 21 2006

a(n)=2^{1+floor(log[2](n))}-n-1 for n>=1; a(0)=1. [From Emeric Deutsch (deutsch(AT)duke.poly.edu), Oct 19 2008]

EXAMPLE

8 = 1000 -> 0111 = 111 = 7

MAPLE

1, seq(2^(1+floor(log[2](n)))-n-1, n=1..81); [From Emeric Deutsch (deutsch(AT)duke.poly.edu), Oct 19 2008]

MATHEMATICA

Table[BaseForm[FromDigits[(IntegerDigits[i, 2]/.{0->1, 1->0}), 2], 10], {i, 0, 90}]

Table[BitXor[n, 2^IntegerPart[Log[2, n] + 1] - 1], {n, 100}] (Delarte)

PROGRAM

(PARI) a(n)=sum(k=1, n, if(bitxor(n, k)>n, 1, 0)) (Hanna)

CROSSREFS

a(n) = A003817(n) - n, for n>0. Cf. A087734.

Cf. A000225, A006257 (Josephus problem).

Sequence in context: A051427 A098825 A111460 this_sequence A004444 A085771 A111106

Cf. A167831, A167877. [From Reinhard Zumkeller (reinhard.zumkeller(AT)gmail.com), Nov 14 2009]

Adjacent sequences: A035324 A035325 A035326 this_sequence A035328 A035329 A035330

KEYWORD

nonn,easy,base,new

AUTHOR

N. J. A. Sloane (njas(AT)research.att.com).

EXTENSIONS

More terms from Vit Planocka (planocka(AT)mistral.cz), Feb 01 2003

a(0) corrected by Paolo P. Lava (ppl(AT)spl.at), Oct 22 2007

page 1

Search completed in 0.003 seconds

Lookup | Welcome | Find friends | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
More pages | Superseeker | Maintained by N. J. A. Sloane (njas@research.att.com)

Last modified November 29 12:46 EST 2009. Contains 167659 sequences.


AT&T Labs Research