WSQ08 – Yo Soy 196

Background Lychrel numbers are natural numbers that do not form a palindrome after successive additions to their inverse. See details on Wikipedia: http://en.wikipedia.org/wiki/Lychrel_number 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. To get this working well, you will need support for Big Integers. You can base your solution off my codebase on GitHub. Unzip all of the files in a directory and use the command "make" to compile. Run the executable. How to use BigInteger and make Video Demo What to Submit As usual, create a blog post explaining what you did, where you found resources (books, videos, web pages, friends) to help you solve this. Remember to put the tag #WSQ08 on your post so our blog hub picks that up. You should include your code as a link to GitHub. You really should start using your GitHub repository now. If you need help on that, just ask Ken or your classmates. And of course, leave any questions here as well as asking those questions on Twitter with the hashtag #TC1017 so we all see your question posted there. Feature Image Credit The Magic Numbers flickr photo by K & P shared under a Creative Commons (BY-NC-ND) license The Magic Numbers flickr photo by K & P shared under a Creative Commons (BY-NC-ND) license

Background

Lychrel numbers are natural numbers that do not form a palindrome after successive additions to their inverse. See details on Wikipedia: http://en.wikipedia.org/wiki/Lychrel_number

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.

This is easier in Python but if you are curious and want to try this in C++ (Java would be similar), to get this working well, you will need support for Big Integers. You can base your solution off my codebase on GitHub. Unzip all of the files in a directory and use the command “make” to compile. Run the executable.

How to use BigInteger and make

Video Demo

What to Submit

As usual, create a blog post explaining what you did, where you found resources (books, videos, web pages, friends) to help you solve this. Remember to put the tag #WSQ08  on your post so our blog hub picks that up.

You should include your code as a link to GitHub. You really should start using your GitHub repository now. If you need help on that, just ask Ken or your classmates.

And of course, leave any questions here as well as asking those questions on our Slack in the #TC1014gda channel so we all see your question posted there.

Feature Image Credit

Background Lychrel numbers are natural numbers that do not form a palindrome after successive additions to their inverse. See details on Wikipedia: http://en.wikipedia.org/wiki/Lychrel_number 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. To get this working well, you will need support for Big Integers. You can base your solution off my codebase on GitHub. Unzip all of the files in a directory and use the command "make" to compile. Run the executable. How to use BigInteger and make Video Demo What to Submit As usual, create a blog post explaining what you did, where you found resources (books, videos, web pages, friends) to help you solve this. Remember to put the tag #WSQ08 on your post so our blog hub picks that up. You should include your code as a link to GitHub. You really should start using your GitHub repository now. If you need help on that, just ask Ken or your classmates. And of course, leave any questions here as well as asking those questions on Twitter with the hashtag #TC1017 so we all see your question posted there. Feature Image Credit <a title="The Magic Numbers" href="https://flickr.com/photos/kenandpauline/5490820">The Magic Numbers</a> flickr photo by <a href="https://flickr.com/people/kenandpauline">K & P</a> shared under a <a href="https://creativecommons.org/licenses/by-nc-nd/2.0/">Creative Commons (BY-NC-ND) license</a> </small> The Magic Numbers flickr photo by K & P shared under a Creative Commons (BY-NC-ND) license
Background
Lychrel numbers are natural numbers that do not form a palindrome after successive additions to their inverse. See details on Wikipedia: http://en.wikipedia.org/wiki/Lychrel_number
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.
To get this working well, you will need support for Big Integers. You can base your solution off my codebase on GitHub. Unzip all of the files in a directory and use the command “make” to compile. Run the executable.
How to use BigInteger and make
Video Demo
What to Submit
As usual, create a blog post explaining what you did, where you found resources (books, videos, web pages, friends) to help you solve this. Remember to put the tag #WSQ08 on your post so our blog hub picks that up.
You should include your code as a link to GitHub. You really should start using your GitHub repository now. If you need help on that, just ask Ken or your classmates.
And of course, leave any questions here as well as asking those questions on Twitter with the hashtag #TC1017 so we all see your question posted there.
Feature Image Credit
The Magic Numbers flickr photo by K & P shared under a Creative Commons (BY-NC-ND) license
The Magic Numbers flickr photo by K & P shared under a Creative Commons (BY-NC-ND) license

CC BY-SA 4.0 WSQ08 – Yo Soy 196 by admin is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.