logoalt Hacker News

tkgally01/22/20251 replyview on HN

Follow-up: My formal study of programming stopped with that Fortran IV class a half century ago, but LLMs now delude me into thinking I can program. I just had Claude write me a Python program to list all of the seven-digit numbers that are both primes and palindromes. It found 668: 1003001, 1008001, 1022201, 1028201, 1035301, ...


Replies

jodrellblank01/23/2025

I wondered if we map English letters to digits (a=0, b=1, c=2, ... , z=25) is there anything which is both a palindrome in its English form and in its number form, and prime? I took a list of palindromes from Wikipedia[1] and tested them, and yes:

deified 3485843

bib 181

did 383

I note that none of them use letters which map to double-digits (k=10, l=11, m=12, etc.); none of the palindrome sentences make palindromic numbers (ignoring case, stripping all punctuation); could there be one which does?

[1] https://en.wiktionary.org/wiki/Appendix:English_palindromes

show 1 reply