DEV Community

Divyajyoti Ukirde
Divyajyoti Ukirde

Posted on

3 2

Thwaites Conjecture - graphically

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!

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

While many AI coding tools operate as simple command-response systems, Qodo Gen 1.0 represents the next generation: autonomous, multi-step problem-solving agents that work alongside you.

Read full post

Top comments (0)

AWS GenAI LIVE image

How is generative AI increasing efficiency?

Join AWS GenAI LIVE! to find out how gen AI is reshaping productivity, streamlining processes, and driving innovation.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay