login
A360147
Primes in base 10 that are also prime when read in a smaller base that is one plus the largest digit in the prime in base 10.
1
2, 3, 5, 7, 11, 13, 23, 31, 37, 43, 61, 73, 101, 103, 107, 113, 131, 151, 223, 227, 233, 241, 251, 277, 307, 311, 331, 337, 373, 401, 461, 463, 467, 521, 547, 557, 577, 661, 673, 701, 827, 887, 1013, 1033, 1103, 1151, 1181, 1213, 1223, 1231, 1301, 1327, 1567
OFFSET
1,1
LINKS
MAPLE
q:= n-> isprime(n) and (l-> (d-> d<9 and isprime(add(l[i]*
(d+1)^(i-1), i=1..nops(l))))(max(l)))(convert(n, base, 10)):
select(q, [$1..2000])[]; # Alois P. Heinz, Jan 27 2023
MATHEMATICA
q[p_] := Module[{d = IntegerDigits[p], b}, b = Max[d] + 1; b <= 9 && PrimeQ[FromDigits[d, b]]]; Select[Prime[Range[250]], q] (* Amiram Eldar, Jan 27 2023 *)
PROG
(Python)
from sympy import isprime
def ok(n):
if not isprime(n): return False
s = str(n)
b = int(max(s)) + 1
return b != 10 and isprime(int(s, b))
print([k for k in range(1600) if ok(k)]) # Michael S. Branicky, Jan 27 2023
(PARI) isok(p)=if(isprime(p), my(v=digits(p), b=vecmax(v)+1); b<10 && isprime(fromdigits(v, b)), 0) \\ Andrew Howroyd, Jan 27 2023
CROSSREFS
Subsequence of A038617.
Sequence in context: A360932 A291691 A178576 * A038970 A079149 A343973
KEYWORD
nonn,base
AUTHOR
Alfred Jacob Mohan, Jan 27 2023
EXTENSIONS
More terms from Michael S. Branicky, Jan 27 2023
STATUS
approved