login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A103144 Decimal primes whose decimal representation in hex is also prime. 5
2, 3, 5, 7, 11, 13, 17, 29, 43, 47, 53, 59, 61, 67, 71, 83, 89, 97, 101, 107, 137, 139, 151, 167, 191, 199, 223, 233, 239, 241, 251, 257, 269, 277, 281, 283, 293, 313, 337, 347, 359, 373, 397, 409, 419, 443, 449, 463, 503, 509, 557, 577, 593, 599, 607, 617, 641 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
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
Cf. A089971.
Sequence in context: A007693 A174048 A249644 * A105909 A197187 A086498
KEYWORD
easy,nonn,base
AUTHOR
Lei Zhou, Jan 26 2005
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 6 08:30 EDT 2024. Contains 372290 sequences. (Running on oeis4.)