A235480 Primes whose base-3 representation is also the base-9 representation of a prime.
2, 5, 7, 11, 17, 19, 23, 31, 37, 41, 43, 53, 67, 71, 73, 83, 89, 97, 103, 149, 157, 199, 239, 251, 257, 271, 277, 293, 307, 313, 331, 337, 359, 383, 397, 421, 431, 433, 499, 541, 557, 571, 587, 599, 601, 613, 631, 653, 659, 661, 683, 691, 709, 727, 751, 769, 823, 887, 911, 983, 1009, 1021, 1031, 1049, 1051, 1063, 1129, 1163, 1217
Offset: 1
Examples
5 = 12_3 and 12_9 = 11 are both prime, so 5 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], 9] &] (* Giovanni Resta, Sep 12 2019 *)
-
PARI
is(p,b=9,c=3)=isprime(vector(#d=digits(p,c),i,b^(#d-i))*d~)&&isprime(p) \\ Note: Code only valid for b > c.
Comments