VOOZH about

URL: https://oeis.org/A384218

⇱ A384218 - OEIS


login
A384218
Numbers k such that the concatenations of k and 123456789 in both orders are prime.
2
217, 409, 629, 653, 779, 871, 881, 1091, 1463, 1489, 1913, 1993, 2039, 2729, 2881, 3397, 3649, 3677, 3751, 3961, 4073, 4321, 4843, 4961, 5039, 5507, 5609, 5683, 5849, 5941, 6593, 6613, 6713, 6923, 7349, 7571, 7789, 7907, 8413, 8419, 8617, 8623, 8687, 8689, 8797, 8909, 9083, 9589, 9973, 10241
OFFSET
1,1
COMMENTS
Numbers k such that both concatenations k123456789 and 123456789k are prime.
LINKS
EXAMPLE
a(3) = 629 is a term because 629123456789 and 123456789629 are prime.
MAPLE
filter:= proc(n) isprime(n*10^9+123456789) and
isprime(123456789*10^(1+ilog10(n))+n) end proc;
select(filter, [seq(i, i=1..20000, 2)]);
MATHEMATICA
Select[Range[1, 12000, 2], PrimeQ[#*10^9 + 123456789] && PrimeQ[123456789*10^IntegerLength[#] + #] &] (* Paolo Xausa, May 23 2025 *)
PROG
(Python)
from sympy import isprime
def ok(n): s = str(n); return all(isprime(int(t)) for t in ["123456789"+s, s+"123456789"])
print([k for k in range(10**4) if ok(k)]) # Michael S. Branicky, May 22 2025
CROSSREFS
Intersection of A232725 and A232727.
Cf. A384174.
Sequence in context: A102658 A145732 A038594 * A020232 A019422 A231558
KEYWORD
nonn,base
AUTHOR
Robert Israel, May 22 2025
STATUS
approved