A231478 Primes whose base-3 representation is also the base-8 representation of a prime.
2, 7, 13, 31, 37, 43, 67, 73, 97, 193, 283, 307, 379, 457, 487, 499, 577, 619, 643, 727, 733, 757, 829, 1297, 1321, 1429, 1447, 1609, 1669, 1693, 2011, 2083, 2137, 2251, 2269, 2347, 2539, 2803, 2857, 2953, 2971
Offset: 1
Examples
13 = 111_3 and 111_8 = 73 are both prime, so 13 is a term.
Links
- Giovanni Resta, Table of n, a(n) for n = 1..10000
- M. F. Hasler, Primes whose base c expansion is also the base b expansion of a prime
Crossrefs
Programs
-
Mathematica
Select[Prime@Range@500, PrimeQ@FromDigits[IntegerDigits[#, 3], 8] &] (* Giovanni Resta, Sep 12 2019 *)
-
PARI
is(p,b=8,c=3)=isprime(vector(#d=digits(p,c),i,b^(#d-i))*d~)&&isprime(p) \\ Note: This code is only valid for b > c.
Comments