cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A070883 Bitwise XOR of n and n-th prime.

This page as a plain text file.
%I A070883 #30 Feb 16 2025 08:32:46
%S A070883 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 A070883 120,127,124,119,112,111,96,163,168,169,182,179,184,133,128,133,154,
%U A070883 159,148,237,232,233,252,239,210,215,218,219,196,205,310,319,308,309,302
%N A070883 Bitwise XOR of n and n-th prime.
%C A070883 For any integer k, XOR(n,k) = 2*OR(n,k) - (n+k). - _Gary Detlefs_, Oct 26 2013
%H A070883 Reinhard Zumkeller, <a href="/A070883/b070883.txt">Table of n, a(n) for n = 1..10000</a>
%H A070883 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Aut.html">aut</a>.
%H A070883 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/XOR.html">XOR</a>.
%F A070883 a(n) = 2*OR(p,n) - (p+n), for n-th prime p. - _Gary Detlefs_, Oct 26 2013
%e A070883 A000040(25)=97, [25]2 = '00011001', [97]2 = '01100001' '00011001' XOR '01100001' = '01111000', therefore a(25)=120.
%t A070883 Table[ BitXor[ n, Prime[n]], {n, 1, 55}]
%o A070883 (Haskell)
%o A070883 import Data.Bits (xor)
%o A070883 a070883 n = a070883_list !! (n-1)
%o A070883 a070883_list = zipWith xor [1..] a000040_list
%o A070883 -- _Reinhard Zumkeller_, Jun 23 2015
%o A070883 (PARI) a(n) = bitxor(n, prime(n));
%o A070883 (Python)
%o A070883 from sympy import prime
%o A070883 def a(n): return n^prime(n)
%o A070883 print([a(n) for n in range(1, 60)]) # _Michael S. Branicky_, Mar 05 2022
%Y A070883 Cf. A169810, A169811, A194187.
%Y A070883 Cf. A265885 (IMPL).
%K A070883 nonn,look
%O A070883 1,1
%A A070883 _Reinhard Zumkeller_, May 22 2002