Page 2 of 2
Re: problem 055
Posted: Wed May 30, 2012 12:35 am
by rayfil
From the description of the problem:
A number that never forms a palindrome through the reverse and add process is called a Lychrel number.
And also:
Surprisingly, there are palindromic numbers that are themselves Lychrel numbers; the first example is 4994.
Edit: Sorry TripleM for the cross-post.
Problem 55
Posted: Fri Dec 28, 2012 3:44 pm
by sunnyalex
Hey there!
I seem to have a problem in understanding "Problem 55" (The "Lychrel-Numbers") correctly.
My algorithm works quite well and returns a total of 246 Lychrel-Numbers below 10,000. But for some reason that is not the expected answer to that problem. However, I looked for "Lychrel-Numbers" in the (German-) Wikipedia
http://de.wikipedia.org/wiki/Lychrel-Zahl. There are listed all Lychrel-Numbers below 3,000 and those are exactly the ones that my algorithm also outputs as Lychrel-Numbers. Furthermore there is a table given that says that there are (in total) 246 Lychrel-Numbers below 10,000 (what is exactly the value that my algorithm calculates).
Does anybody have an idea what could be wrong there? Is Wikipedia wrong?
I know the "requested" answer to that problem, but I do not understand where the difference between projecteuler.net's answer and the Wikipedia-value does come from.
Kind regards!
Keep up the good work!
Alex
Re: Problem 55
Posted: Fri Dec 28, 2012 8:19 pm
by TripleM
There's already a thread for problem 55 here:
viewtopic.php?f=50&t=1746
I suspect you'll find an answer to your problem there (or, as it stands, the problem statement).
Re: problem 055
Posted: Fri Dec 28, 2012 8:41 pm
by thundre
sunnyalex wrote:I looked for "Lychrel-Numbers" in the (German-) Wikipedia
http://de.wikipedia.org/wiki/Lychrel-Zahl. There are listed all Lychrel-Numbers below 3,000 and those are exactly the ones that my algorithm also outputs as Lychrel-Numbers. Furthermore there is a table given that says that there are (in total) XXX Lychrel-Numbers below 10,000 (what is exactly the value that my algorithm calculates).
Assuming I'm interpreting that table correctly, it disagrees slightly with my algorithm (which uses the 50-iteration threshhold specified in the problem). The English-language Wikipedia page says that no known non-Lychrel numbers less than 10,000 take more than 24 iterations.
One of the two must be wrong. For the purposes of this problem, you will get the desired answer if you correctly apply the 50-iteration rule.
edit:
The difference between the German table and my results can be explained by
palindromic Lychrel numbers that the Germans didn't count.
Re: problem 055
Posted: Fri Dec 28, 2012 9:18 pm
by rayfil
@sunnyalex
We realize you are new to this forum. For several reasons, problem numbers below 100 are padded with leading 0's to make them 3-digit numbers. Don't start a new subject if one already exists. You should also read the sticky thread entitled "Comments, questions and ..."
Your post has thus been merged with the proper thread.
Re: problem 055
Posted: Sat Dec 29, 2012 8:16 am
by sunnyalex
thundre wrote:
edit:
The difference between the German table and my results can be explained by palindromic lychrel numbers that the Germans didn't count.
This was exactly the mistake in my algorithm. It skipped numbers that were palindromes themselves in the first step. Now I adjusted the algorithm and I get the requested result!
Thank you everybody.
And please excuse the inconveniences caused by me opening a new thread. I searched for "problem 55" and did not get any results so I did not notice that there was already a thread called "problem 055"
Kind regards!
Alex
Re: problem 055
Posted: Sun Mar 20, 2016 9:20 pm
by Jeptha
I really enjoy encountering new ideas that stem from the Project Euler problems. Thank you, Euler & team! I extended my problem solution a little bit to make a graph of the number iterations required against n. Then I did a little more reading.
I thought I'd share this link I came across in looking further into Lychrel numbers, as I didn't see it in this thread and thought people reading here may enjoy it:
http://www.p196.org/
Re: problem 055
Posted: Mon Mar 28, 2016 12:30 am
by TheBonobo4
Numberphile did
a video on Lychrel numbers. Might be useful for the problem at hand.
Re: problem 055
Posted: Wed Feb 08, 2017 12:42 am
by AMWJ
This question is unclear whether zero (0) is a Lychrel number, or if somehow a negative number could be. The definition of a Lychrel number should read:
"A positive integer that never forms a palindrome through the reverse and add process is called a Lychrel number."
Or the question should be posed, "How many positive Lychrel numbers are there below ten-thousand?"
Re: problem 055
Posted: Wed Feb 08, 2017 1:02 am
by dawghaus4
When a problem "name" a number or concept that I'm not familiar with, I look it up.
From Wikipedia: A Lychrel number is a natural number that cannot form a palindrome through the iterative process of repeatedly reversing its digits and adding the resulting numbers.
There are times I wish the problems were more forthcoming with the terminology or use of conventions; but this one wasn't one of them.
Tom
Re: problem 055
Posted: Wed Feb 08, 2017 1:21 am
by AMWJ
I don't think it's fair to assume the reader would look up what a Lychrel number is: I avoid looking up terms in Project Euler problems because I'm afraid what I come across may spoil the problem for me. Especially in this problem, it was possible that looking up the relevant terms could reveal a formula to figure out how many Lychrel numbers are less than a given integer before I'd derived it.
Besides, I think this is a fairly easy fix, and one that clears up an ambiguity in which neither reading seemed preferable without external resources.
Re: problem 055
Posted: Wed Feb 08, 2017 9:27 am
by hk
0+reverse(0)=0+0=0. 0 is a palindrome. So?
It seems to me that reverse(-1) is not defined, at least not as a number.
So it seems to me that you could have answered your questions yourself without looking up anything,
Re: problem 055
Posted: Thu Dec 21, 2023 9:55 pm
by bkarlenko
My algorithm works quite well and returns a total of 246 Lychrel-Numbers below 10,000.
Had the same problem. My total was 246 no matter how long I debug. It turned out I had to read the description better:
Surprisingly, there are palindromic numbers that are themselves Lychrel numbers; the first example is 4994
So when I included initial palindromes to my checks, I got the correct answer
Hope this helps those who search by "246" query