[go: up one dir, main page]

login
A090708
Primes whose decimal representation is a valid number in base 5 and interpreted as such is again a prime.
8
2, 3, 23, 43, 131, 241, 313, 401, 1123, 1231, 1321, 2111, 2113, 2221, 2311, 3323, 4003, 4241, 4423, 10103, 10301, 10433, 11243, 11423, 12011, 12413, 13331, 14323, 14411, 20113, 20201, 20443, 21011, 21143, 21341, 21433, 22111, 22133, 22441, 23431, 24113, 24421, 24443, 30211, 31223
OFFSET
1,1
EXAMPLE
23 is prime when read as base-10 number and also when read as base-5 number, 23 [base 5] = 13 [base 10].
MATHEMATICA
Select[ FromDigits@# & /@ IntegerDigits[ Prime@ Range@ 270, 5], PrimeQ] (* Robert G. Wilson v, Jan 05 2014 *)
PROG
(PARI) fixBase(n, oldBase, newBase)=my(d=digits(n, oldBase), t=newBase-1); for(i=1, #d, if(d[i]>t, for(j=i, #d, d[j]=t); break)); fromdigits(d, newBase)
list(lim)=my(v=List(), t); forprime(p=2, fixBase(lim\1, 10, 5), if(isprime(t=fromdigits(digits(p, 5), 10)), listput(v, t))); Vec(v) \\ Charles R Greathouse IV, Nov 07 2016
(Magma) [n:n in PrimesUpTo(32000)| Max(Intseq(n, 10)) le 4 and IsPrime(Seqint(Intseq(Seqint(Intseq(n), 5))))]; // Marius A. Burtea, Jun 30 2019
KEYWORD
base,nonn
AUTHOR
Cino Hilliard, Jan 18 2004
EXTENSIONS
Name, example and offset corrected by M. F. Hasler, Jan 03 2014
More terms from Alejandro J. Becerra Jr., Aug 13 2018
STATUS
approved