OFFSET
1,1
COMMENTS
LINKS
EXAMPLE
The first terms, alongside n XOR a(n), are:
n a(n) n XOR a(n)
-- ---- ----------
1 2 3
2 1 3
3 4 7
4 3 7
5 6 3
6 5 3
7 10 13
8 11 3
9 12 5
10 7 13
11 8 3
12 9 5
MATHEMATICA
nn = 2^10; c[_] := False; a[1] = 2; c[2] = True; u = 1; Do[k = u; While[Nand[! c[k], PrimeQ@ BitXor[n, k]], k++]; Set[{a[n], c[k]}, {k, True}]; If[k == u, While[c[u], u++]], {n, 2, nn}]; Array[a, nn] (* Michael De Vlieger, Jan 21 2023 *)
PROG
(PARI) { s = 0; for (n=1, 67, for (v=1, oo, if (!bittest(s, v) && isprime(bitxor(n, v)), print1 (v", "); s += 2^v; break))) }
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Jan 19 2023
STATUS
approved