🔢 CHALLENGE: LYCHREL NUMBERS like 1⃣9⃣6⃣ (maybe) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

🔢 CHALLENGE: LYCHREL NUMBERS like 1⃣9⃣6⃣ (maybe)

It's simple! Write a function that return the number of iterations it takes to prove that a number is not a lychrel number. What??? A Lychrel number can't form a palindrome through the iterative process of repeatedly reversing its digits and adding the resulting numbers, says Wikipedia. 56 >> 65 >> 56 + 65 = 121 that is palindrome so output is 1. 57 >> 75 >> 57 + 75 = 132 >> 231 >> 132 + 231 = 363 it's palindrome so output is 2. In base ten no Lychrel numbers have been yet proved to exist. Can you?

28th Sep 2017, 10:13 PM
Andrea Simone Costa
Andrea Simone Costa - avatar
3 Answers
28th Sep 2017, 11:24 PM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 2
https://code.sololearn.com/crAGzny7T8AX/?ref=app
29th Sep 2017, 1:32 PM
Hiroki Masuda
Hiroki Masuda - avatar
+ 1
This is my solution. If you start whit a palindrome number output will be 0. https://code.sololearn.com/chpaHqaNEDUm/?ref=app
29th Sep 2017, 8:00 AM
Andrea Simone Costa
Andrea Simone Costa - avatar