A231474 Primes whose base-3 representation is also the base-5 representation of a prime.
2, 3, 5, 7, 13, 17, 29, 31, 37, 41, 59, 67, 79, 97, 101, 109, 113, 137, 139, 149, 151, 173, 181, 193, 223, 229, 251, 269, 271, 293, 311, 331, 353, 367, 373, 379, 383, 389, 397, 401, 457, 467, 491, 503, 617, 631, 641, 647, 653, 673, 701, 773, 787, 797, 809, 829, 853, 857, 911, 929, 953, 977
Offset: 1
Examples
7 = 21_3 and 21_5 = 11 are both prime, so 7 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], 5] &] (* Giovanni Resta, Sep 12 2019 *)
-
PARI
is(p,b=5,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