Is $q=37$ the only prime such that $qd$ and $q^2 d$ are base-$10$ palindromes, where $d = 9018009$?

52 Views Asked by At

Is $q=37$ the only prime such that $qd$ and $q^2 d$ are base-$10$ palindromes, where $d = 9018009$?

Note that $$37d = 333666333$$ and $${37}^2 d = 12345654321$$ when $$d = 9018009 = {3^2}\cdot{7^2}\cdot{{11}^2}\cdot{{13}^2}.$$

I tried checking for $q \leq 101$ and found only $q=37$.

Context

From the comments: I came across this question while fiddling around with the only Descartes spoof that is known.

1

There are 1 best solutions below

2
On BEST ANSWER

Checking all $q$ from $0$ to $10^8$ with a Python program gives the following $(q,qd,q^2d)$ triples

d=9018009
def is_palindrom(n):
    s1=str(n) 
    return  s1==s1[::-1]
for q in range(100000000):
    if is_palindrom(q*d):
        if is_palindrom(q**2*d):
            print((q,q*d,q**2*d))
(0, 0, 0)
(37, 333666333, 12345654321)
(3367, 30363636303, 102234363432201)
(336367, 3033360633303, 1020322416142230201)
(366337, 3303630363033, 1210242036302420121)
(33336667, 300630363036003, 10022014302620341022001)
(33636367, 303333060333303, 10203022140604122030201)
(36663337, 330630303036033, 12122010222622201022121)
(36963037, 333333000333333, 12321000024642000012321)

another Python program generates and checks numbers of a special structures

d=9018009
def is_palindrom(n):
    s1=str(n) 
    return  s1==s1[::-1]

h=3300
for t in range(30):
    q=h+67
    h+=63
    h*=100
    if is_palindrom(q*d):
        if is_palindrom(q**2*d):
            print(q)
3367
336367
33636367
3363636367
336363636367
33636363636367
3363636363636367
336363636363636367
33636363636363636367
3363636363636363636367
336363636363636363636367
33636363636363636363636367
3363636363636363636363636367
336363636363636363636363636367
33636363636363636363636363636367
3363636363636363636363636363636367
336363636363636363636363636363636367
33636363636363636363636363636363636367
3363636363636363636363636363636363636367
336363636363636363636363636363636363636367
33636363636363636363636363636363636363636367
3363636363636363636363636363636363636363636367
336363636363636363636363636363636363636363636367
33636363636363636363636363636363636363636363636367
3363636363636363636363636363636363636363636363636367
336363636363636363636363636363636363636363636363636367
33636363636363636363636363636363636363636363636363636367
3363636363636363636363636363636363636363636363636363636367
336363636363636363636363636363636363636363636363636363636367
33636363636363636363636363636363636363636363636363636363636367