login
A393014
Primes that are palindromic in both base 2 and base 9.
0
3, 5, 7, 127, 19433, 90352181, 26315683709701629860193397, 615850986357618363622206847, 2073722573406568398837217962245683
OFFSET
1,1
EXAMPLE
127 is a term since 127 = 1111111_2 = 151_9, both palindromes.
19433 is a term since 19433 = 100101111101001_2 = 28582_9, both palindromes.
90352181 is a term since 90352181 = 101011000010101010100001101_2 = 208010802_9, both palindromes.
MATHEMATICA
Select[Prime[Range[10^6]], PalindromeQ[#] && PalindromeQ[IntegerString[#, 2]] && PalindromeQ[IntegerString[#, 9]] &]
PROG
(PARI)
ispal(n, b)=my(d=digits(n, b)); d==Vecrev(d);
forprime(p=2, 10^15, if(ispal(p, 2)&&ispal(p, 9), print1(p, ", ")))
(Python)
from gmpy2 import next_prime, mpz
def ispal(n, b):
d = []
while n:
d.append(n % b)
n //= b
return d == d[::-1]
p = mpz(2)
while True:
if ispal(p, 2) and ispal(p, 9):
print(p, end=", ")
p = next_prime(p)
CROSSREFS
Primes in A259385.
Intersection of A016041 and A029977.
Sequence in context: A292848 A128344 A259385 * A114366 A088092 A174271
KEYWORD
nonn,base,more,hard,changed
AUTHOR
Yusuf Yıldız, Feb 28 2026
EXTENSIONS
a(7)-a(9) from Max Alekseyev, May 29 2026
STATUS
approved