OFFSET
0,1
LINKS
Robert Israel, Table of n, a(n) for n = 0..175
MAPLE
N:= 100: # to get a(0)..a(N)
A295520:= proc(n) local k;
for k from 0 do if isprime(Bits:-Xor(k, n)) then return k fi od
end proc:
V:= Array(0..N, -1):
count:= 0:
for n from 0 while count < N+1 do
r:= A295520(n);
if r <= N and V[r]=-1 then
count:= count+1; V[r]:= n
fi
od:
convert(V, list); # Robert Israel, Nov 27 2017
MATHEMATICA
With[{s = Array[Block[{k = 0}, While[! PrimeQ@ BitXor[k, #], k++]; k] &, 10^6]}, FirstPosition[s, #][[1]] /. 1 -> 0 & /@ Take[#, LengthWhile[Differences@ #, # == 1 &]] &@ Union@ s] (* Michael De Vlieger, Nov 27 2017 *)
PROG
(Python)
from itertools import count
from sympy import isprime
def A295793(n): return next(k for k in count(0) if next((m for m in range(n+1) if isprime(k^m)), None)==n) # Chai Wah Wu, Aug 23 2023
CROSSREFS
KEYWORD
AUTHOR
Robert Israel, Nov 27 2017
STATUS
approved