Page 1 of 2
problem 055
Posted: Mon Nov 23, 2009 9:20 pm
by phaul
I think the example with 10667 is wrong. After a couple of iterations it arrives to the palindrome 2326666232.
Although this isn't relevant as far as the problem is concerned, should be rectified
10667 + 76601 == 87268
87268 + 86278 == 173546
173546 + 645371 == 818917
818917 + 719818 == 1538735
1538735 + 5378351 == 6917086
6917086 + 6807196 == 13724282
13724282 + 28242731 == 41967013
41967013 + 31076914 == 73043927
73043927 + 72934037 == 145977964
145977964 + 469779541 == 615757505
615757505 + 505757516 == 1121515021
1121515021 + 1205151211 == 2326666232.
Paul.
Re: problem 055
Posted: Mon Nov 23, 2009 9:34 pm
by phaul
ah, ignore me ; I'm being an idiot. the example was 10677

Re: problem 055
Posted: Fri Apr 09, 2010 5:37 pm
by heiba
Hey guys,
This is obviously about
Problem 55 (
View Problem)
I solved it, I got all the Lychrel numbers below 10000. Mentioned in the question, 196 and 4994 are Lycherals. I got them which confirms my method is correct. But I don't know why my answer is not accepted as correct. I made sure millions of times. I don't know what I can say and what I can't say in order not to spoil. But I followed the 50 iterations rule mentioned in the question, I made sure that they occur exactly 50 times not more or less. I tried changing it to 49 iterations, I got a slightly different number. I tried it, it's also wrong. I'm pretty sure about my first answer. and don't know what can I be missing ?
If you can't think of anything to help me with, can you please explain EXACTLY what does "How many Lychrel numbers are there below ten-thousand?" in case I misunderstood it, which is not probable.
Thanks everyone
Re: problem 055
Posted: Fri Apr 09, 2010 5:51 pm
by heiba
OOOPPPSSSSSS, that was the most unseen mistake I have ever did.
I used unsigned int thinking they'de be large enough, I WAS WRONG. had to use unsigned __int64 to avoid numbers being overlapped. DAMN IT. coding in C++ btw
Re: problem 055
Posted: Sat Apr 10, 2010 6:32 pm
by rayfil
I used unsigned int thinking they'de be large enough
It's just another example satisfying my usual signature.

Re: problem 055
Posted: Tue Oct 12, 2010 10:01 pm
by Seralt
I'm somewhat unclear on the parameters of the problem. Does the reverse of a number have to maintain the same length of digits? (e.g. if "1" is the reverse of "10", then 10+1 == 11, which is a palindrome.)
Re: problem 055
Posted: Wed Oct 13, 2010 12:38 am
by elendiastarman
Seralt wrote:I'm somewhat unclear on the parameters of the problem. Does the reverse of a number have to maintain the same length of digits? (e.g. if "1" is the reverse of "10", then 10+1 == 11, which is a palindrome.)
Leading zeros are not allowed in this case. In your example, you're really doing 01+10 = 11. Hence, yes, the reverse of a number will have the same number of digits.
That help?
Re: problem 055
Posted: Wed Oct 13, 2010 7:40 am
by Lord_Farin
elendiastarman wrote:
Leading zeros are not allowed in this case.
Please point to a PE problem that does allow leading zeroes... I was under the assumption that leading zeroes are disallowed for every single one of them (so far, this assumption hasn't been falsified)
Re: problem 055
Posted: Wed Oct 13, 2010 2:56 pm
by elendiastarman
Lord_Farin wrote:elendiastarman wrote:
Leading zeros are not allowed in this case.
Please point to a PE problem that does allow leading zeroes... I was under the assumption that leading zeroes are disallowed for every single one of them (so far, this assumption hasn't been falsified)
Hmm...I seem to remember that there was just one problem that did...but I may be wrong. No big deal.
Re: problem 055
Posted: Tue Feb 08, 2011 2:14 am
by Soabirw
Running into some issues on this one. My code definitely generates palindromes and only increments the answer if one is found. I think I'm missing some exclusion rules though. I am excluding numbers with leading 0s. I.E. 10 + 01. I just skip 10. So basically all numbers that are a multiple of 10 gets skipped. Beyond that it looks like the vast majority of numbers will add up to a palindrome before hitting 50 iterations. Is there a lower bound? Should I not allow numbers like 1, 2, etc? They will create a palindrome before 50 iterations as well. What other exclusions might I be missing?
Re: problem 055
Posted: Tue Feb 08, 2011 2:53 am
by Soabirw
Reading comprehension failure on my part. Read on wiki that Lychrel numbers are numbers that CAN'T be turned into palindromes. I read the description 10 times and kept thinking it meant Lychrels are numbers that can turn into palindromes. Leaving my silliness to hopefully be a warning to others.
Re: problem 055
Posted: Tue Feb 08, 2011 5:48 pm
by browni3141
I think the wording should be changed to "How many probable Lychrel numbers are there below ten-thousand?"
If a number satisfies the conditions presented int the question then the number is a probable Lychrel number.
None are actually known to exist.
Re: problem 055
Posted: Sun Jul 03, 2011 10:10 am
by harishkrishnapsbb
When I output all the Lychrel Numbers less than 10000, numbers such as 89, 177 are displayed. I manually checked and found that at least till 10 iterations they don't yield a palindrome. Are they Lychrel numbers?
And did anyone else face this problem?
Re: problem 055
Posted: Sun Jul 03, 2011 10:44 am
by jaap
harishkrishnapsbb wrote:... at least till 10 iterations they don't yield a palindrome.
The problem states that you should try 50 iterations, and that if that still doesn't give a palindrome then you may assume it is a Lychrel number. The numbers 89 and 177 do produce palindromes within 50 iterations (24 and 15 iterations respectively).
Re: problem 055
Posted: Mon Aug 15, 2011 5:20 am
by frogjg2003
Are 2,4,6 and 8 considered palindromes?
Re: problem 055
Posted: Mon Aug 15, 2011 5:59 am
by TripleM
Yes, they read the same back to front to me.
Re: problem 055
Posted: Tue Sep 06, 2011 5:05 am
by drwhat
Just thought I'd post a few tips, as I got some confused and misleading ideas from reading previous posts. Also in case you think your algorithm is correct but still not getting the right answer, here are few reasons I had to fumble through.
1) Leading zeroes are not candidates for discarding a number if they occur from the flip process. For example, if 280 must be tested as 280 + 82 = 362 (thanks to rayfil for pointing out a big oops ), is a valid first step. There are in fact a few Lychrel numbers that are multiples of 10.
2) Initially Palindromic Numbers Can be Lychrel Hehe I know this is stated in the problems but I overlooked it.
3) Data types, Data Types, Data Types!! I ran into a few overflow problems even with 64bit variables. The numbers get suprisingly big for additions.
Re: problem 055
Posted: Wed Sep 07, 2011 1:23 am
by rayfil
For example, if 280 must be tested as 280 + 28 = 308, is a valid first step
WRONG.
280 + 082 = 362 would be a valid first step!

Re: problem 055
Posted: Wed May 30, 2012 12:02 am
by JMW1994
Do you have to reverse the number and add both the original and reversed number at least once before you can call the number palindromic if the initial number is palindromic?
Re: problem 055
Posted: Wed May 30, 2012 12:23 am
by TripleM
Did you see this line of the problem, which makes the answer very clear:
Surprisingly, there are palindromic numbers that are themselves Lychrel numbers; the first example is 4994.