Anyone that has studied secondary school mathematics knows what a prime number is but just to recap the definition of a prime number is any number which is only divisible by 1 and itself. 1 is however not a prime number as it is only divisible by itself, and other than 2 all prime numbers …
Continue reading Prime Numbers
Day:18 May 2020
Is Odd? or is Even?
In my last post I wrote a program to print the Collatz Conjecture for a particular number. In this program I had to check if the number is odd or not(even). For my next program I will need to do this check again so I have decided to write a very short function to check …
Continue reading Is Odd? or is Even?
Collatz Conjecture (The Code)
In the This program just returns the value for a single value so we need to wirte an extra function to get the sequence: The code above adds the values in the sequence to an array and then prints simply prints the array to the screen, running the code above produces the following output: This …
Continue reading Collatz Conjecture (The Code)
Collatz Conjecture (The Math)
I was watching one of my favourite youtube channels Numberphile and came across a video which for convenience i have embedded into this post on the Collatz Conjecture. The Collatz Conjecture is named for Lothar Collatz who introduced the idea in 1937. It is a simple sequence which is defined as: This may look a …
Continue reading Collatz Conjecture (The Math)