Message Boards Message Boards

Lucky Palindromes: when do prime factors of palindromes make palindromes?

Posted 11 months ago

enter image description here

Attachments:
POSTED BY: Vitaliy Kaurov
10 Replies

Pub. Mat. and SP standard message

enter image description here -- you have earned Featured Contributor Badge enter image description here Your exceptional post has been selected for our editorial columns Staff Picks http://wolfr.am/StaffPicks and Publication Materials https://wolfr.am/PubMat and Your Profile is now distinguished by a Featured Contributor Badge and is displayed on the Featured Contributor Board. Thank you!

POSTED BY: Moderation Team

There is one construction method that leads to the majority of lucky palindromes so far. Take a prime whose digits are all ones or zeroes, with at most 9 ones, such that its digit reversal is also prime. Their product will not generate any carries, and is a (doubly lucky) palindrome, such as

121121010242121121383121121242010121121 == 11001000011000001011*11010000011000010011

There can also be a two and up to five ones, that just fits (note the central 9):

10201112123150905132121110201 == 100001001010201*102010100100001

And then there are the repunit primes. Combined with 11 they form palindromes of the form 122...221.

12222222222222222221 == 1111111111111111111*11 == 11*1111111111111111111

This happens to be the only lucky palindrome of length 20. I'll wrap up my search and report back with a followup post.

POSTED BY: Roman Maeder

Why do you exclude palindromes with a single (multiple) prime factor? they make for some pretty patterns, and in particular, a lucky palindrome that is a square has a prime factor that is itself a palindrome, like this 17 digit example:

12323244744232321 == 111010111 111010111

which is also a double lucky palindrome, of course. There are higher powers, as well:

343 == 7 7 7
14641 == 11 11 11 11
POSTED BY: Roman Maeder

Great question. Because there is no asymmetry. It is easy to get a palindrome from 2 or more identical palindromes. But it is much harder for not-identical non-palindromic factors to line up to form a palindrome. I am just curious about these not-trivial cases, if that makes sense.

POSTED BY: Vitaliy Kaurov

...with a single (multiple) prime factor

I see what you mean, those a interesting too. Do you see how frequent they are? Do you have an impression they are sensibly more frequent than cases with multiple distinct factors ?

POSTED BY: Vitaliy Kaurov

There are not that many. There are just two examples with 17 digits,

10022212521222001 == 100111001 100111001
12323244744232321 == 111010111 111010111

none with 18 digits (there's just a single, very lucky, palindrome with 18 digits) and none so far with 19 digits (search still ongoing):

POSTED BY: Roman Maeder

I actually agree, Roman, single multiple prime factor are also very nice. When you done with your search I'd love to see the sequences complete with those numbers and the optimized code. Thank you very much for looking into this.

POSTED BY: Vitaliy Kaurov

The search can be optimized, and I have been running one for the last two hours or so. There are no lucky palindromes with 16 digits. There are a couple with 17 digits, and I just found one with 18 digits:

294507705507705492 == 2231118981118981 11 3 2 2

but no more than five factors so far.

POSTED BY: Roman Maeder

Wow, Roman, great, thank you! It would be really interesting to see the optimized code.

"...no lucky palindromes with 16 digits"

-- do you mean in both ascending and descending order?

294507705507705492 == 223111898111898111322

-- remarkable! And again 5 factors tops - very interesting. I wonder if 7-factors even possible.

POSTED BY: Vitaliy Kaurov

do you mean in both ascending and descending order?

both, I factor the number only once, and then test for both ascending and descending at the same time. They are just a Reverse[] apart.

POSTED BY: Roman Maeder
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract