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!)
A070883 Bitwise XOR of n and n-th prime. 9

%I #29 Mar 05 2022 14:18:22

%S 3,1,6,3,14,11,22,27,30,23,20,41,36,37,32,37,42,47,80,83,92,89,68,65,

%T 120,127,124,119,112,111,96,163,168,169,182,179,184,133,128,133,154,

%U 159,148,237,232,233,252,239,210,215,218,219,196,205,310,319,308,309,302

%N Bitwise XOR of n and n-th prime.

%C For any integer k, XOR(n,k) = 2*OR(n,k) - (n+k). - _Gary Detlefs_, Oct 26 2013

%H Reinhard Zumkeller, <a href="/A070883/b070883.txt">Table of n, a(n) for n = 1..10000</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/Aut.html">aut</a>.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/XOR.html">XOR</a>.

%F a(n) = 2*OR(p,n) - (p+n), for n-th prime p. - _Gary Detlefs_, Oct 26 2013

%e A000040(25)=97, [25]2 = '00011001', [97]2 = '01100001' '00011001' XOR '01100001' = '01111000', therefore a(25)=120.

%t Table[ BitXor[ n, Prime[n]], {n, 1, 55}]

%o (Haskell)

%o import Data.Bits (xor)

%o a070883 n = a070883_list !! (n-1)

%o a070883_list = zipWith xor [1..] a000040_list

%o -- _Reinhard Zumkeller_, Jun 23 2015

%o (PARI) a(n) = bitxor(n, prime(n));

%o (Python)

%o from sympy import prime

%o def a(n): return n^prime(n)

%o print([a(n) for n in range(1, 60)]) # _Michael S. Branicky_, Mar 05 2022

%Y Cf. A169810, A169811, A194187.

%Y Cf. A265885 (IMPL).

%K nonn,look

%O 1,1

%A _Reinhard Zumkeller_, May 22 2002

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 June 6 16:10 EDT 2024. Contains 373133 sequences. (Running on oeis4.)