login
A054258
Concatenation of n in base 2 up to base 10 and n in base 10 down to base 2 is prime, all numbers are interpreted as decimals.
3
2607, 4007, 4069, 7597, 12411, 13583, 23041, 31113, 32619, 46187, 48469, 55777, 61411, 64387, 71143, 73837, 84761, 103559, 123797, 124043, 126613, 136509, 142019, 147449, 183981, 186889, 200183, 204219, 214819, 221101, 224123, 230977, 235493, 249049, 256489
OFFSET
1,1
LINKS
EXAMPLE
a(1) = 2607 is a term since both 10100010111110120120220233404122002310413505735162607 and
26073516505710413200234041222023310120120101000101111 are prime.
MATHEMATICA
Select[Range[250000], AllTrue[{FromDigits[Flatten[Table[IntegerDigits[#, b], {b, 2, 10}]]], FromDigits[ Flatten[Table[IntegerDigits[#, b], {b, 10, 2, -1}]]]}, PrimeQ]&] (* Harvey P. Dale, May 28 2023 *)
PROG
(Python)
from gmpy2 import digits, is_prime
def ok(n): return is_prime(int("".join(digits(n, b) for b in list(range(2, 11))))) and is_prime(int("".join(digits(n, b) for b in list(range(10, 1, -1)))))
print([k for k in range(234567) if ok(k)]) # Michael S. Branicky, May 28 2023
CROSSREFS
Intersection of A054256 and A054257.
Sequence in context: A212083 A236889 A254695 * A236666 A252341 A235777
KEYWORD
nonn,base
AUTHOR
Patrick De Geest, Feb 15 2000
EXTENSIONS
Offset changed to 1 and a(33) and beyond from Michael S. Branicky, May 28 2023
STATUS
approved