# “Out of idle curiosity” question about a program generating palindromic prime numbers

I'm a programmer and software designer. I'm definitely not a mathematician and my maths is quite basic, so this is not the kind of place I feel comfortable in. :)

In order to win a bet with a friend of mine, who challenged me to generate a palindromic prime number, at least 1000 digits long and using only the digits 1 and 7 (yeah, we were a bit "fuzzy" that night), I wrote a horrible Java hack built around an instinctive and somewhat faulty conjecture... that is so crazy and pointless that would take a lot of time to explain.

I won the bet because I generated this stuff in about 10 minutes:

71771177771711117177717711111717117111711777117717117117777117711117177711177777171777717111771777717777111711717711177711177771771717117777177777777771777111177717177777771177177717777171177771771111717177777117717117711777177771177111711777711717711717771177771711117117171171771111771717777711177171171771717111117711111711177717171117777777111171777717777117117711177111711771777771111777171117711717711117777117111711177771777111777111777117777171711711717111771117777111777171111711111111717177171111117111771117177777771711717171171171117171171177111171777117717771177771171717111771111117777177771111117711171717117777117771771177717111177117117171117117117171711717777777171117711171111117177171711111111711117177711177771117711171711711717177771177711177711177717777111711171177771111771711771117177711117777717711711177111771171177771777717111177777771117171777111711111771111171717717117177111777771717711117717117171171111717777117771711771711777711711177117777177711771171771177777171711117717777117177771777177117777777171777111177717777777777177771171717717777111777111771711711177771777717711171777717177777111777171111771177771171171771177711711171171711111771777171111717777117717


It is palindromic, it is 1199 digits long, and seems to be prime or, at least, Mathematica PrimeQ tells so, but I didn't test it with a deterministic method.

Actually, sometimes my program can generate numbers like that one in a snap, other times it just fails or hangs. I'm interested, out of idle curiosity, in knowing why it works (when it does) and if it uses some known feature of palindromic primes. Are you interested in, too? Can I open a topic?

If so, what tags should I use? I mean, there is no "curiosity", all of them seem pretty serious. Isn't it better to post right here, editing this topic?

-
OK, I posted it. math.stackexchange.com/questions/248671/… –  gd1 Dec 1 '12 at 17:13

Yeah. ${}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}$

-
What tags should I use? I mean, there is no "curiosity", all of them seem pretty serious. Isn't it better to post right here, editing this topic? –  gd1 Dec 1 '12 at 16:06
@gd1: You may want to use something about prime number, and perhaps recreational mathematics, and/or number theory. –  Asaf Karagila Dec 1 '12 at 16:28

Expanding on hjg, in maths everything is "curiosity", and unlike some other StackExchange sites there should be no compulsion for the math.stackexchange.com questions to be "practical, answerable questions based on actual problems that you face". (I struck out answerable because we still don't want open-ended questions.)

I note however that quote, which I went over to superuser.com to obtain, is currently in the faq!

-