Xmas 2021 Puzzle(1)

L D[AR2P#0.0]

Lifetime Supporting Member
Join Date
Nov 2006
Location
UK
Posts
6,694
Find 3 palindromic numbers that, when added together, make 85709
(Numbers are in Base 10)


Answers by pm please.
 
All-in -- one through five-digit palindromes -- I found 957 solutions.

There is an Excel workbook named PalPuzzle.xlsm in the file download section, Misc folder. It is not necessary to enable macros to view the 957 palindrome sums for 85709 in the Solution worksheet. Macros are required to try other numbers via the Puzzle worksheet.
 
...I found 957 solutions...

I duplicated @Mispeld's results (thanks for the correction!): the same 957 solutions; interestingly, they come from 956(!) possible palindromic decimal numbers that are less than 85709

Source is in Downloads: xmas21_puzzle_1.zip under Misc; 17 active lines of Python; runs in ~6s or less on my laptop.
 
9.9 is I guess palendromic

Palindrome, yes in the textual sense, but not numeric per the definition in the paper linked in post #6.

Nevertheless, stretching the definition to include a decimal point (i.e., #.#, ##.##, ###.###) does not affect the result for 85709. Still just 957 solutions.

Some smaller test values tend to get many more hits, such as the value 110 goes from 22 integer solutions all the way to 617 when floating point palindromes are considered. The following clip shows a few examples.

Pal Frac.PNG

Setting aside the unconventional (non-integer) palindromes, I ran some tests to understand the efficiency of the algorithm running in the uploaded Excel workbook. The attached tables and associated plots show the results for different input values, 8571, 85709, 857090, and 8570900. In this case the time increases linearly, indicating O(n) on the magnitude of the input value.

More interesting is what happens when the number of addends changes. This is the number of palindromes added together to reach the target value. The puzzle defines this as three, and is the focus of the proof in the post #6 paper.

You can see in the Log-Y chart that result time increases exponentially with the number of addends O(10^n). Not desirable, but also not surprising with the brute-force structure that almost certainly repeatedly, and needlessly, re-evaluates the same partial results. Might be something to look at before going back to the mundane, real-world programming.

Numeric Benchmarks:

Pal Tables.PNG

Graphs:

Pal Charts.PNG
 
Nevertheless, stretching the definition to include a decimal point (i.e., #.#, ##.##, ###.###) does not affect the result for 85709. Still just 957 solutions.

Some smaller test values tend to get many more hits, such as the value 110 goes from 22 integer solutions all the way to 617 when floating point palindromes are considered.

Nice work!
 
Sweet.


You inspired me to get my three-addend solution for 85709 down to around 0.05-0.06s, and only 15 active lines.
 
Last edited:

Similar Topics

No solutions posted so re-running this one from 2017 http://www.plctalk.net/qanda/showpost.php?p=760646&postcount=1
Replies
3
Views
1,631
It was too early for Easter, suppose I could have done Chinese New year, but that's too close to Valentines Day. Two parts : 1. A Logix5000...
Replies
1
Views
1,316
Two brothers were walking down the road. The first brother poses a question to the other: 'If I take the digits 1 through 9 and write them down...
Replies
4
Views
1,759
A mother and child walk down an escalator which is running at constant speed in the downward direction. Once on the escalator, the child walks...
Replies
5
Views
2,005
Contruct three fractions all of the same value, using in every group all the nine digits once only. The fractions may be formed in the ways shown...
Replies
35
Views
12,723
Back
Top Bottom