## DEV Community is a community of 699,738 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

# Thwaites Conjecture - graphically

Divyajyoti Ukirde
I'm currently ðŸŒ± learning and ðŸ”­ working on the Javascript Ecosystem. ðŸ˜„ Pronouns: she/her âš¡ Fun fact: I have a Computer Engineering background but the most credit goes to Google and Stack Overflow

What are conjectures?

Wikipedia says "In mathematics, a conjecture is a conclusion or a proposition which is suspected to be true due to preliminary supporting evidence, but for which no proof or disproof has yet been found".

So, from one of these conjectures, I came across was the Thwaites Conjecture.
The algorithm proceeds as below:
Think of a positive whole number,
if the number is odd, multiply by 3 and add 1,
if the number is even, just half it.
Keep repeating this procedure, you'll eventually reach 1.

So, to see why this is true, I thought of plotting every step on the graph to see if there is any pattern. You can go ahead and comment your observations. Unfortunately, I couldn't find any pattern but I understood how `canvas` was used.

I am currently in the process of improving this project.
The height and width need to be scaled properly to make all the points visible.

Any suggestions are welcome.

Happy coding!