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
3, 1, 6, 3, 14, 11, 22, 27, 30, 23, 20, 41, 36, 37, 32, 37, 42, 47, 80, 83, 92, 89, 68, 65, 120, 127, 124, 119, 112, 111, 96, 163, 168, 169, 182, 179, 184, 133, 128, 133, 154, 159, 148, 237, 232, 233, 252, 239, 210, 215, 218, 219, 196, 205, 310, 319, 308, 309, 302 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
For any integer k, XOR(n,k) = 2*OR(n,k) - (n+k). - Gary Detlefs, Oct 26 2013
LINKS
Eric Weisstein's World of Mathematics, aut.
Eric Weisstein's World of Mathematics, XOR.
FORMULA
a(n) = 2*OR(p,n) - (p+n), for n-th prime p. - Gary Detlefs, Oct 26 2013
EXAMPLE
A000040(25)=97, [25]2 = '00011001', [97]2 = '01100001' '00011001' XOR '01100001' = '01111000', therefore a(25)=120.
MATHEMATICA
Table[ BitXor[ n, Prime[n]], {n, 1, 55}]
PROG
(Haskell)
import Data.Bits (xor)
a070883 n = a070883_list !! (n-1)
a070883_list = zipWith xor [1..] a000040_list
-- Reinhard Zumkeller, Jun 23 2015
(PARI) a(n) = bitxor(n, prime(n));
(Python)
from sympy import prime
def a(n): return n^prime(n)
print([a(n) for n in range(1, 60)]) # Michael S. Branicky, Mar 05 2022
CROSSREFS
Cf. A265885 (IMPL).
Sequence in context: A207630 A368376 A126191 * A120029 A201904 A133110
KEYWORD
nonn,look
AUTHOR
Reinhard Zumkeller, May 22 2002
STATUS
approved

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 May 12 23:55 EDT 2024. Contains 372497 sequences. (Running on oeis4.)