[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A235394
Primes whose decimal representation is a valid number in base 8 and interpreted as such is again a prime.
68
2, 3, 5, 7, 13, 23, 37, 53, 73, 103, 107, 131, 211, 227, 263, 277, 307, 337, 373, 401, 431, 433, 463, 467, 521, 541, 547, 557, 577, 631, 643, 661, 673, 701, 1013, 1063, 1151, 1153, 1201, 1223, 1327, 1423, 1451, 1453, 1531, 1567, 1613, 1627, 1663, 1721, 2011, 2017
OFFSET
1,1
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
EXAMPLE
a(5) = 13_10 = prime(5), 13_8 = 3 + 1*8 = 11_10 = prime(4).
a(8) = 53_10 = prime(16), 53_8 = 3 + 5*8 = 43_10 = prime(14). - Marius A. Burtea, Jun 30 2019
MATHEMATICA
Select[FromDigits@# & /@ IntegerDigits[ Prime@ Range@ 270, 8], PrimeQ]
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, 8), if(isprime(t=fromdigits(digits(p, 8), 10)), listput(v, t))); Vec(v) \\ Charles R Greathouse IV, Nov 07 2016
(Magma) [n:n in PrimesUpTo(2100)| Max(Intseq(n, 10)) le 7 and IsPrime(Seqint(Intseq(Seqint(Intseq(n), 8))))]; // Marius A. Burtea, Jun 30 2019
KEYWORD
base,easy,nonn
AUTHOR
Robert G. Wilson v, Jan 09 2014
STATUS
approved