OFFSET
1,1
COMMENTS
Original definition: Primes p such that p XOR 8 = p + 8.
This is an example of a class of primes p such that p XOR n = p + n.
LINKS
Indranil Ghosh, Table of n, a(n) for n = 1..10000
EXAMPLE
103 is in the sequence because 103 mod 16 is 7 which is less than 8. - Indranil Ghosh, Jan 18 2017
MATHEMATICA
Select[Prime[Range[200]], Mod[#, 16]<8&] (* Harvey P. Dale, Jan 11 2018 *)
PROG
(Magma)
XOR := func<a, b | Seqint([ (adigs[i] + bdigs[i]) mod 2 : i in [1..n]], 2)
where adigs := Intseq(a, 2, n)
where bdigs := Intseq(b, 2, n)
where n := 1 + Ilog2(Max([a, b, 1]))>;
for n in [2 .. 1000] do
if IsPrime(n) then pn:=n;
if (XOR(pn, 8) eq pn+8) then pn; end if;
end if;
end for;
(PARI) is_A214588(p)={ !bittest(p, 3) & isprime(p) } \\ M. F. Hasler, Jul 24 2012
(PARI) forprime(p=1, 699, bittest(p, 3) || print1(p", ")) \\ M. F. Hasler, Jul 24 2012
(Python)
from sympy import isprime
i=1
j=1
while j<=10000:
if isprime(i)==True and (i%16)<8:
print str(j)+" "+str(i)
j+=1
i+=1 # Indranil Ghosh, Jan 18 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Brad Clardy, Jul 22 2012
STATUS
approved