Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Strongest palindrome

399 views
Skip to first unread message

lakshmiamul...@gmail.com

unread,
May 18, 2019, 12:19:21 PM5/18/19
to
Ms. A loves palindrome strings. She always looks for palindrome in any letter she finds. Recently she realizes the infinite number PI could contain a lot of palindrome in its infinite sequence.
It's impossible to find all palindromes manually. So she decided to write a program that will find the longest palindrome from the input string!

Mike Terry

unread,
May 18, 2019, 12:56:41 PM5/18/19
to
On 18/05/2019 17:19, lakshmiamul...@gmail.com wrote:
> Ms. A loves palindrome strings. She always looks for palindrome in any letter she finds. Recently she realizes the infinite number PI could contain a lot of palindrome in its infinite sequence.
> It's impossible to find all palindromes manually. So she decided to write a program that will find the longest palindrome from the input string!
>

The number PI is generally thought to be "normal":

https://en.wikipedia.org/wiki/Normal_number

although I don't think this is proven. If PI is indeed normal it would
contain arbitrarily long palindromes in its digit sequence. In
particular, there would be no "longest palindrome from the input string".

If PI isn't normal, perhaps there could be a longest palindrome,
although a program simply examining an infinite stream of digits would
obviously never recognise this, so it would never terminate.

If it were one day proven that the longest palindrome had a specific
(known) bound on its length, then Ms A could write a program to find
this, and the program would be guaranteed to terminate, although it
would probably require more resources to run than those available to Ms A!

Regards,
Mike.

Mike Terry

unread,
May 18, 2019, 10:01:33 PM5/18/19
to
That last paragraph isn't right. What I meant was that if we had a
proof that PI had a longest palindrome, and the proof gave us the actual
length of the palindrome, a program could just search until it found a
palindrome of that length and then terminate...

Mike.

Richard Heathfield

unread,
May 19, 2019, 4:08:18 AM5/19/19
to
On 18/05/2019 17:56, Mike Terry wrote:
>
> The number PI is generally thought to be "normal":
>
>    https://en.wikipedia.org/wiki/Normal_number

Pi, like any normal number, has 6 decimal places:

3.141592
^^^
and contains just one non-trivial palindrome (length > 1).

.
.
.
.
.

No, wait, hang on a sec... This is Usenet, right?

Sorry, I thought it was Twitter, where they swallow this kind of junk
hook, line, and sinker. Every time.

--
Richard Heathfield
Email: rjh at cpax dot org dot uk
"Usenet is a strange place" - dmr 29 July 1999
Sig line 4 vacant - apply within

Gene Wirchenko

unread,
May 21, 2019, 7:38:23 PM5/21/19
to
On Sun, 19 May 2019 09:08:12 +0100, Richard Heathfield
<r...@cpax.org.uk> wrote:

>On 18/05/2019 17:56, Mike Terry wrote:
>>
>> The number PI is generally thought to be "normal":
>>
>>    https://en.wikipedia.org/wiki/Normal_number
>
>Pi, like any normal number, has 6 decimal places:
>
>3.141592
> ^^^
>and contains just one non-trivial palindrome (length > 1).
>
>.
>.
>.
>.
>.
>
>No, wait, hang on a sec... This is Usenet, right?
>
>Sorry, I thought it was Twitter, where they swallow this kind of junk
>hook, line, and sinker. Every time.

You monster! Now you have me wondering what the longest
palindrome in the first 100,000 digits of pi is.

Sincerely,

Gene Wirchenko

Mark Brader

unread,
May 21, 2019, 10:31:04 PM5/21/19
to
Gene Wirchenko:
> You monster! Now you have me wondering what the longest
> palindrome in the first 100,000 digits of pi is.

Assuming that http://www.angio.net/pi/digits/pi1000000.txt has the
correct digits, it'd be 0136776310, starting at the 16061st decimal
place.

I'm actually surprised that it's unique and that short. In the whole
million digits, there are 9 other palindroms of length 10 digits,
9 of length 11, one of length 12, and one of length 13. But all of
these are between the 240,000th and 940,000th decimal places.

(The two longest are 450197791054, at the 273,840th decimal place, and
9475082805749, at the 879,326th. A simple C program found all of these
in less than a second, then took half an hour to confirm that there are
no longer ones in the first million digits.)
--
Mark Brader, Toronto "Remember that computers are very,
m...@vex.net very fast..." -- Steve Summit

My text in this article is in the public domain.

Eric Sosman

unread,
May 22, 2019, 7:17:47 AM5/22/19
to
On 5/21/2019 10:30 PM, Mark Brader wrote:
> Gene Wirchenko:
>> You monster! Now you have me wondering what the longest
>> palindrome in the first 100,000 digits of pi is.
>
> Assuming that http://www.angio.net/pi/digits/pi1000000.txt has the
> correct digits, it'd be 0136776310, starting at the 16061st decimal
> place.
>
> I'm actually surprised that it's unique and that short. [...]

Sounds about right to me. A ten-digit palindrome must start with
five digits ABCDE, then continue with E (probability roughly 1/10),
D (1/10), C (1/10), B (1/10), A (1/10), so the likelihood of the EDCBA
continuation is about 1e-5. In the first 1e5 digits of pi, one
occurrence of a (1e-5)-probability event is just about what I'd expect.

--
eso...@comcast-dot-net.invalid
Six hundred nine days to go.

Mark Brader

unread,
May 22, 2019, 2:08:28 PM5/22/19
to
Gene Wirchenko:
>>> You monster! Now you have me wondering what the longest
>>> palindrome in the first 100,000 digits of pi is.

Mark Brader:
>> Assuming that http://www.angio.net/pi/digits/pi1000000.txt has the
>> correct digits, it'd be 0136776310, starting at the 16061st decimal
>> place.
>>
>> I'm actually surprised that it's unique and that short. [...]

Eric Sosman:
> Sounds about right to me. A ten-digit palindrome must start with
> five digits ABCDE, then continue with E (probability roughly 1/10),
> D (1/10), C (1/10), B (1/10), A (1/10), so the likelihood of the EDCBA
> continuation is about 1e-5.

You're right, of course. I was only thinking about the observed rate
of other palindromes in the first million digits, and not about the
probabilitistic reasons for that.

In particular, it didn't occur to me that 10-digit and 11-digit
palindromes have the same probability of 1e-5, which fits with them
occurring about equally often in the first million digits -- but it
also means it's, shall we say, slightly surprising that there isn't
also an 11-digit palindrome in the first 100,000 digits.
--
Mark Brader | "The only thing required for the triumph of darkness
Toronto | is for good men not to call Hydro."
m...@vex.net | --Michael Wares

Basil Jet

unread,
May 22, 2019, 11:41:58 PM5/22/19
to
See also https://en.wikipedia.org/wiki/Six_nines_in_pi

--
Basil Jet recently enjoyed listening to
Animal Collective - 2018 - Tangerine Reef

Phil Carmody

unread,
May 30, 2019, 2:22:32 PM5/30/19
to
m...@vex.net (Mark Brader) writes:
> Gene Wirchenko:
> >>> You monster! Now you have me wondering what the longest
> >>> palindrome in the first 100,000 digits of pi is.
...
> In particular, it didn't occur to me that 10-digit and 11-digit
> palindromes have the same probability of 1e-5, which fits with them
> occurring about equally often in the first million digits -- but it
> also means it's, shall we say, slightly surprising that there isn't
> also an 11-digit palindrome in the first 100,000 digits.

But only slightly surprising.
As (1-1/big)^big ~ 1/e
P(10 and 11 found) = 0.400
P(10 or 11 found) = 0.465
P(neither found) = 0.135

Phil
--
In order for there to be rights, there must be wrongs - if you want to
get rid of wrongs, which great leaders do, you *must* get rid of rights.

Mark Brader

unread,
May 30, 2019, 8:21:14 PM5/30/19
to
Mark Brader:
> > ...but it also means it's, shall we say, slightly surprising that...

Phil Carmody:
> But only slightly surprising.

Violent agreement!
--
Mark Brader, Toronto "... trapped in a twisty little maze
m...@vex.net of backslashes ..." -- Steve Summit

rober...@gmail.com

unread,
Feb 15, 2020, 8:27:30 PM2/15/20
to
besides the self-palindromic ones you mentioned, at 12-digites there are the following palindromic pairs in the first 1,000,000 digits, from the same source you cite.
(Interesting there is only 1 12-digit repeating sequence, "756130190263" in the same set). Why are there 4 times more palindromes than repeats?

"826086201398"
"893102680628"

"450197791054" self

"324623125383"
"383521326423"

"404631767287"
"782767136404"

"475082805749"
"947508280574"

"383521326423" self
0 new messages