WSQ11, Lovely 196, not.

maxresdefault

Hello people. I am here to post about the new program that I made and that takes me 10000000000 hours of headache. I was lost making this program, until I decided to ask for help to the dream team: Darío, Baruquismen and Batmantec and also my teacher Ken, who tolds me that I had to start with a diagram to understand better the logic of the program.

And well, for this program we have 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

To make that I use a function called REVERSE to get the palindrome, and then, using conditionals (IF) I sent the result to Lychrel, NonLychrel or Palindrome.

And that is my code:

c19
c192

On terminal:

g19

Thanks to Batmantec, Baruquismen, Darío and Alberto (Cerritos sucks).

Check my GitHub or one of the people that I mentioned before.

https://github.com/eduardomrlsg/TC101/blob/master/WSQ11%20196

Regards, EdMo.

 

 

CC BY-SA 4.0 WSQ11, Lovely 196, not. by eduardomoralesg is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.