# WSQ08 – Yo Soy 196

--Originally published at マルコ

What to Do

Your job is to create a program that asks the user for two pieces of data:

  • The lower bound of the sequence
  • The upper bound of the sequence
Then you check the values from the lower bound (inclusive) to the upper bound (inclusive) and make a report of them. During the analysis of each number, if a Lychrel number is found it should be reported immediately with something like “Found a Lychrel number: 196”

Details

The report must show:
  • The range of numbers analysed (lower to upper bound)
  • The number of natural palindromes (no addition to inverse needed)
  • The number of non-Lycherels encountered (become palindromes)
  • The number of Lycherel number candidates (that did not converge to palindrome)

Since you will not be able to prove that a number is Lycherel (since you cannot computer forever to check), our definition for a Lycherel candidate will be if a number does not converge after 30 iterations of applying the addition to the inverse.

lyrchel

lyrchel2

Featured image:

# 196 Dex


Lycherels: Yo Soy 196!

--Originally published at Python learning

This week I worked with a problem called Yo Soy 196, which consisted of receiving a range of numbers from the user and determining the ones that were natural palindromes, non-lycherels and lycherels.

I didn’t know the definition of a lycherel number, so of course I started by reading about that:

https://en.wikipedia.org/wiki/Lychrel_number

After I fully understood what I had to do, I started writing my code. When I was done, it had a problem because it ran, but it displayed some numbers as lycherels that were not actually correct. I spent a lot of time trying to figure out why, and I asked several classmates for help. The person who at the end made me see my mistake was a fellow computer science student who took Ken’s class last semester (you can check out his blog here). Turns out, I was not initializing to zero my variable times every time it changed number, so the next one took the last value it got in the while loop ? .

I corrected it and it finally did the right thing! ?

lycherel

As you can see, I used the range() function in my for loop. It was my first time using it, and I learned how it works from this page:

http://pythoncentral.io/pythons-range-function-explained/

And lastly, this is how it worked:

lycherel_run

 


WSQ-08

--Originally published at Héctor Santillán

En esta ocasión debemos crear un programa que contenga una función que nos especifique de un rango de datos que ingresemos cuales números son palíndromos naturales, cuáles no y los candidatos a números de Lychrel.

Creamos dos funciones pequeñas que hagan los procesos de reversa del número y de la suma del número y su inverso. Luego empezamos la función principal, en la cuál ponemos un for para que realize la operación con cada número de la lista y con los if y while especificamos a que categoría pertenecera cada número.

Este programa lo realizé con mis conocimientos previos y simplifique su tamaño con el apoyo del profesor de la materia.


#WSQ08

--Originally published at Not a Programming Blog

Task

Your job is to create a program that asks the user for two pieces of data:

  • The lower bound of the sequence
  • The upper bound of the sequence
Then you check the values from the lower bound (inclusive) to the upper bound (inclusive) and make a report of them. During the analysis of each number, if a Lychrel number is found it should be reported immediately with something like “Found a Lychrel number: 196”.
Details
The report must show:
  • The range of numbers analysed (lower to upper bound)
  • The number of natural palindromes (no addition to inverse needed)
  • The number of non-Lycherels encountered (become palindromes)
  • The number of Lycherel number candidates (that did not converge to palindrome)


WSQ08 -Lychrel numbers

--Originally published at Elu's Blog

For this assignment, these were my instructions:

Your job is to create a program that asks the user for two pieces of data:

  • The lower bound of the sequence
  • The upper bound of the sequence
Then you check the values from the lower bound (inclusive) to the upper bound (inclusive) and make a report of them. During the analysis of each number, if a Lychrel number is found it should be reported immediately with something like “Found a Lychrel number: 196”
The report must show:
  • The range of numbers analysed (lower to upper bound)
  • The number of natural palindromes (no addition to inverse needed)
  • The number of non-Lycherels encountered (become palindromes)
  • The number of Lycherel number candidates (that did not converge to palindrome)

Since you will not be able to prove that a number is Lycherel (since you cannot computer forever to check), our definition for a Lycherel candidate will be if a number does not converge after 30 iterations of applying the addition to the inverse.

This is what I came up with:

Captura de pantalla 2017-02-27 a la(s) 20.29.53.png

Captura de pantalla 2017-02-27 a la(s) 20.30.12.png