4 ms·
My family’s phone number when I was a child was both a palindrome and a prime: 7984897. My parents had had the number for two decades without noticing it was a
by tkgally 2y ago
My family’s phone number when I was a child was both a palindrome and a prime: 7984897.
My parents had had the number for two decades without noticing it was a palindrome. I still remember my father’s delight when he got off a phone call with a friend: “Doug just said, ‘Hey, I dialed your number backwards and it was still you who answered.’ I never noticed that before!”
A few years later, around 1973, one of the other math nerds at my high school liked to factor seven-digit phone numbers by hand just for fun. I was then taking a programming class—Fortran IV, punch cards—and one of my self-initiated projects was to write a prime factoring program. I got the program to work, and, inspired by my friend, I started factoring various phone numbers. Imagine my own delight when I learned that my home phone number was not only a palindrome but also prime.
Postscript: The reason we hadn’t noticed that 7984897 was a palindrome was because, until around 1970, phone numbers in our area were written and spoken with the telephone exchange name [1]. When I was small, I learned our phone number as “SYcamore 8 4 8 9 7” or “S Y 8 4 8 9 7.” We thought of the first two digits as letters, not as numbers.
Second postscript: I lost contact with that prime-factoring friend after high school. I see now that she went on to earn a Ph.D. in mathematics, specialized in number theory, and had an Erdős number of 1. In 1985, she published a paper titled “How Often Is the Number of Divisors of n a Divisor of n?” [2]. She died two years ago, at the age of sixty-six [3].
[1] https://en.wikipedia.org/wiki/Telephone_exchange_names https://en.wikipedia.org/wiki/Telephone_exchange_names
[2] https://www.sciencedirect.com/science/article/pii/0022314X85900125 https://www.sciencedirect.com/science/article/pii/0022314X85...
[3] https://www.legacy.com/us/obituaries/legacyremembers/claudia-spiro-obituary?id=38593759 https://www.legacy.com/us/obituaries/legacyremembers/claudia...
- tkgally 2y ago> In 1985, she published a paper titled “How Often Is the Number of Divisors of n a Divisor of n?” Claudia Spiro seems to have remained actively interested in prime numbers into her sixties. In 2017, she published a paper titled “On three consecutive prime-gaps”: https://projecteuclid.org/journals/rocky-mountain-journal-of-mathematics/volume-47/issue-5/On-three-consecutive-prime-gaps/10.1216/RMJ-2017-47-5-1711.full https://projecteuclid.org/journals/rocky-mountain-journal-of...
- dhosek 2y agoI thought everybody factors phone numbers. I also factor the odometer reading in my car while driving.
- noman-land 2y agoHow do you do mental factoring?
- dhosek 2y agoI don’t usually keep the factors, but I have a variety of techniques. Putting aside the trivial cases of divisibility by 2, 3, 5, 11¹ and 37², a lot of it comes down to find ways to make the numbers smaller, so, for example. my current odometer reading is 13,857. To test for divisibility by 7, I can turn that into 14,000-13852=143 which I can tell at a glance isn’t divisible by 7. It is divisible by 3, so I can reduce it to 4619 which isn’t divisible by 3 and I can also tell it’s not divisible by 11. I can also rule out 19 at a glance. To check 13, I might do my right-side divisibility test where I start by subtracting 39 from the right, which gives 458. I could continue with that, but taking 39 from the left gets me to a small enough number faster of 68 which isn’t divisible by 13. Right-side divisibility for 17 takes 119 from the right leaving 45 which isn’t divisible by 17. For 23, I can do a left-side removal of 46 to rule that out. 29, go right to bring it to 459 and then 43, not divisible by 29. For 31, I’ll do right side to get 434 and then 31 so 4619=149×31 and 149 is prime and I’m done. ⸻ 1. To check for divisibility by 11, subtract the sum of even numbered digits from the sub of odd numbered digits. If 11∣n, then you’ll have a multiple of 11. E.g., for 13,857, we compare (3+5)-(1+8+7)=-8 which is not a multiple of 11.³ 2. To check for divisibility by 111, we take advantage of the fact that 3×37=111, 27×37=999 and thus 1000≡1(mod 37) and we can then add up the digits in groups of 3, and pull out the most convenient multiple of 111 to see if we have 0, 37 or 74. E.g., with our example about, 13+852=865-888=-23 which is not a multiple of 37. 3. As an added bonus that number is the remainder when dividing by 11. Similarly the number I get with the check in footnote 2 is the remainder when dividing by 37.
- tkgally 2y agoInteresting! What do you do when you try to factor a large number that doesn't yield to any of your mental factoring techniques? It might be prime, after all, or composite with only large prime factors. Do you give up after a while? Run it through a factoring program? Keep plugging away until you get to the number's square root?
- tkgally 2y agoFollow-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, ...
- jodrellblank 2y agoI 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 https://en.wiktionary.org/wiki/Appendix:English_palindromes
- tkgally 2y agoHow about representing the words as numbers in base 26? That would preserve the palidromicity for both the word and the number, and primality would not be affected by the base representation. Might not be as much fun, though.
- jodrellblank 2y agoRetesting the words like that does find some: REPAPER/5305958597, DUD/2551, DID/2239, LEMEL/5105267, PEEWEEP/4683479543. With this hackish code to interpret the text as base 26, rebase that to base10, test primality, I can't test the sentences (I think it might be overflowing on the higher value words, even). I think it's not so fun if the base 10 numbers are not palindromic.
- tkgally 2y agoThanks for trying! I was thinking of creating a set of digits for base 26 using emoji or other Unicode characters. Then the numbers would at least look like palindromes. But I don't know how interesting palindromes in an ad hoc character set would be.