cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A103144 Decimal primes whose decimal representation in hex is also prime.

Original entry on oeis.org

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
Offset: 1

Views

Author

Lei Zhou, Jan 26 2005

Keywords

Examples

			11 is prime, Hex(11) = 17 is prime, hence 11 is in the sequence.
		

Crossrefs

Cf. A089971.

Programs

  • 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;
    
  • Mathematica
    Select[Prime@ Range@ 120, PrimeQ@ FromDigits[IntegerDigits@ #, 16] &] (* Michael De Vlieger, Nov 05 2018 *)
  • 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