/WondrousNumbers

A fantastic journey into the wondrous realm of the Collatz conjecture.

Primary LanguageJupyter Notebook

Wondrous Numbers

Background

Wondrous numbers are defined thus: Start with an arbitrary natural number. If the number is even, divide it by 2. If it is odd, multiply by 3 and add 1. Repeat until you come out with 1. A number is wondrous if and only if it eventually reaches 1 through this process.

Create a programme which takes one scalar argument x, and tells you whether or not x is wondrous, and if it is, how many operations did it take to reach 1.

This was my very first programming assignment, given to me by a friend in the spring of 2017, as I prepared to change careers having zero knowledge of programming and computers and very rusty math. All I was told by a masters program I was interested in applying for was to "learn R". And so the wondrous journey started...