A070883 Bitwise XOR of n and n-th prime.
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
Offset: 1
Examples
A000040(25)=97, [25]2 = '00011001', [97]2 = '01100001' '00011001' XOR '01100001' = '01111000', therefore a(25)=120.
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
- Eric Weisstein's World of Mathematics, aut.
- Eric Weisstein's World of Mathematics, XOR.
Programs
-
Haskell
import Data.Bits (xor) a070883 n = a070883_list !! (n-1) a070883_list = zipWith xor [1..] a000040_list -- Reinhard Zumkeller, Jun 23 2015
-
Mathematica
Table[ BitXor[ n, Prime[n]], {n, 1, 55}]
-
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
Formula
a(n) = 2*OR(p,n) - (p+n), for n-th prime p. - Gary Detlefs, Oct 26 2013
Comments