HOME plateWON | World!OfNumbers Palindromic Subsetsof Concatenated Sequences Sum of First Numbertypes Sequence Products Reversal Products Pythagorean Triples Palindromes in other Bases Various Palindromic Sums

Introduction

Palindromic numbers are numbers which read the same from
left to right (forwards) as from the right to left (backwards)
Here are a few random examples : 7, 3113, 44611644
```
```

Examples

Index NrPalindromic Subsets of Concatenated SequencesLength

Concatenated Prime Sequence
3 3511|3517|3527|3529|3533|3539|3541|3547|3557 9
2 2741|2749|2753|2767|2777|2789|2791|2797|2801 7
1 3|5|7|11|13|17|19|23|29|31|37|41|43|47|53 5

You are kindly invited to find larger palindromes as substrings
in 'prime'- or 'other' sequence concatenations !

[ November 25, 2003 ]
Contribution by Dw (email)

I wrote a program to find such palindromic sequences with "record length",
meaning, to find a sequence at least longer than the previous sequence found,

The results for the first 98654 primes were:

(flank [8, 11] ) #|11|#   Length 2
(center [8, 12] ) #|11|1#3|   Length 3
(center [19, 26] ) |1#9|23|29|#   Length 5
(center [234, 243] ) |31#7|331|337|#   Length 7 *
(center [647, 658] ) |100#9|1013|1019|#   Length 9 *
(flank [6019, 6030] ) |1010#3|10111|1013#3|   Length 10
(center [18007, 18020] ) |2991#7|29921|29927|#   Length 11
(center [79043, 79058] ) |13828#9|138311|138319|#   Length 13
(flank [158566, 158581] ) |2#77279|277297|277#301|   Length 14

Flank palindromes are ones which have two center digits, e.g 7447.
Center palindromes are ones which have only one center digit, e.g 74347.

The vertical line | pipe symbol separates the respective digits,
while the # marks show the start and end of the palindromic sequence.

For example, for the length 5 palindrome, the bars show that the primes
involved are 19, 23, and 29. The palindrome itself is 92329.

The numbers in brackets show the position of the palindromic sequence in a
string of the numbers concatenated and separated with the vertical line
symbols mentioned above.

* Note that it found an earlier length 7 and length 9 sequence than the ones

[ December 2, 2003 ]
Suite by Dw (email)

I replaced the prime number detection with a sieve and did some other tweaks,
though I'm running it close to the memory limit given by the sieve, so I
probably won't find any larger palindromic concatenations of prime numbers
for a while.

The relevant program output is:

New record found of size 19.
(center [706236, 706257] )#|1292113|1292131|12921#41|
New record found of size 21.
(center [865835, 865858] )|157508#3|1575113|1575131|157513#7|
New record found of size 22.
(flank [9612474, 9612498] )#|18008113|18008131|180081#53|
New record found of size 24.
(flank [10621868, 10621894] )|1988911#7|19889137|19889173|1988917#9|
New record found of size 26.
(flank [30358705, 30358734] )|581184#97|58118537|58118573|58118579|#
New record found of size 27 ( Note by PDG 916282611716282617116282619 is a palindromic prime ! ).
(center [84723469, 84723498] )|16282610#9|162826117|162826171|16282619#9|
New record found of size 34.
(flank [122423120, 122423157] )#|234843239|234843277|234843293|2348432#99|

String length: 187895520
Last prime: 362559997

First I use a Sieve of Eratosthenes to get all primes up to the
maximum prime number mentioned as "last prime". I then dump all the prime
numbers found by that method into a linked list and erase the sieve array so
I'll have enough memory for the next step. This consists of concatenating the
printed equivalents of the numbers between |s -- e.g 2, 3, 5 becomes |2|3|5.
Once that is done I run a function to find palindromes on every position in
that string and print "New record found" if the longest palindrome it found
originating from that position was larger than the last record.

I have 512M RAM and 256M virtual memory, and the boundary for how
large a sieve I can have (unless I do tricks like using only odd numbers) is

The modularity of the code would make it simple to create analogous
versions for other sieve based numbers, eg luckies.

Index NrPalindromic Subsets of Concatenated Sequences (Dw)Length

Concatenated Prime Sequence
??|?|?|?|?|?|?|??
16234843227|234843233|234843239|234843277|234843293|234843299|234843311|23484331334
15162826049|162826091|162826109|162826117|162826171|162826199|162826231|162826243
916282611716282617116282619 Prime Curios!
27
1458118381|58118449|58118497|58118537|58118573|58118579|58118591|5811860326
1319889083|19889087|19889117|19889137|19889173|19889179|19889189|1988920324
1218008071|18008093|18008113|18008131|18008153|18008161|1800816722
111575031|1575071|1575083|1575113|1575131|1575137|1575139|157514321
101292089|1292099|1292113|1292131|1292141|1292143|129214919
9277261|277273|277279|277297|277301|277309|27733114
8138251|138283|138289|138311|138319|138323|13833713
729879|29881|29917|29921|29927|29947|2995911
610093|10099|10103|10111|10133|10139|1014110
5991|997|1009|1013|1019|1021|10319
4311|313|317|331|337|347|3497
313|17|19|23|29|31|375
25|7|11|13|17|193
15|7|11|13|17|192

[ November, 2004 ]
Carlos Rivera asked in his Puzzle 289 for
" Palprimes inside the infinite primes concatenated "

Giovanni Resta and J. K. Andersen engaged to the puzzle using their own methods
and insights and came up with some stunning new records !
The full story can be read in Carlos excellent puzzle page.
Allow me to duplicate from both puzzlers their two largest palindromic subsequences.
GR got these two solutions which beat the cited with 34 digits by Dw and span 5 primes.
51 = (1666661119 11666661137 11666661173 11666661191 11666661)203
53 = (46735376419 46735376437 46735376473 46735376491 467353764)97
JKA has two palprime record solutions spanning 5 and even 6 consecutive primes.
61 = 108767(976780119 108767976780137 108767976780173 108767976780191 1087679)76780289
105 = 19605310868013506908(9 196053108680135069119 196053108680135069137 196053108680135069173 196053108680135069191 19605310868013506919)7

Found byPalindromic Subsets of Concatenated SequencesLength

Concatenated Prime Sequence
GR?|?|1666661119|11666661137|11666661173|11666661191|11666661203|?|?51
GR?|?|46735376419|46735376437|46735376473|46735376491|46735376497|?|?53

JKA?|?|108767976780119|108767976780137|108767976780173|
108767976780191|1087679
76780289|?|?
61
JKA?|?|196053108680135069089|196053108680135069119|196053108680135069137|
196053108680135069173|196053108680135069191|19605310868013506919
7|?|?
105

```

```