A235633 Primes whose base-4 representation is also the base-8 representation of a prime.
2, 3, 7, 11, 19, 29, 37, 59, 71, 89, 97, 107, 149, 167, 223, 227, 251, 281, 337, 347, 439, 461, 463, 491, 499, 509, 521, 563, 599, 617, 647, 653, 659, 701, 727, 733, 739, 751, 757, 769, 797, 809, 823, 877, 887, 907, 911, 929, 937, 1031, 1087, 1093, 1109, 1163, 1187, 1193, 1297
Offset: 1
Examples
7 = 13_4 and 13_8 = 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[#, 4], 8] &] (* Giovanni Resta, Sep 12 2019 *)
-
PARI
is(p,b=8,c=4)=isprime(vector(#d=digits(p,c),i,b^(#d-i))*d~)&&isprime(p) \\ Note: This code is only valid for b > c.
Comments