OFFSET
1,1
LINKS
Andreas Boe, Table of n, a(n) for n = 1..10000
EXAMPLE
11 is prime, Hex(11) = 17 is prime, hence 11 is in the sequence.
MATHEMATICA
Select[Prime@ Range@ 120, PrimeQ@ FromDigits[IntegerDigits@ #, 16] &] (* Michael De Vlieger, Nov 05 2018 *)
PROG
(MATLAB) a = primes(300000); j = 0; for i = 1:19000 b = dec2hex(a(i)); c = num2str(b); d = str2num(c); if d < 2^32 if isprime(d) j = j + 1; e(j) = d; end; end; end;
(PARI) isok(p) = isprime(p) && isprime(fromdigits(digits(p), 16)); \\ Michel Marcus, Nov 05 2018
(Python)
from sympy import isprime
def ok(n): return isprime(n) and isprime(int(str(n), 16))
print([k for k in range(642) if ok(k)]) # Michael S. Branicky, Dec 04 2022
CROSSREFS
KEYWORD
easy,nonn,base
AUTHOR
Lei Zhou, Jan 26 2005
STATUS
approved