Free Trial

Weekly Challenges

Solve the challenge, share your solution and summit the ranks of our Community!

Also available in | Français | Português | Español | 日本語
IDEAS WANTED

Want to get involved? We're always looking for ideas and content for Weekly Challenges.

SUBMIT YOUR IDEA

Challenge #475: The Collatz Conjecture

Tofel
9 - Comet
Spoiler
Challenge 475a.jpg

Challenge 475b.jpg

alexnajm
18 - Pollux
18 - Pollux

Fun one!

Spoiler
Challenge 475 macro.pngChallenge 475 workflow.png
martinson
11 - Bolide

Happy with how I did this. Great challenge

Spoiler
13:05
Cheers,
martinson

LinkedIN

Bulien
abacon
12 - Quasar
Spoiler
image.png

Here is how I did it. Iterative macros are so beneficial to know, very useful tool.

Here is my solution

myastarling
10 - Fireball

ohmigosh this was fun fun fun!

Bennu
8 - Asteroid

Super cool challenge! 

I was going to use 2 macros (1 to go through the numbers and another to iterate through each number's processing) but thought maybe I could put it all together with a single macro.  

Initially i thought the code had an issue but quickly realized 100 iteration was way too low for all numbers iterations combined (when going up to 10,000) since many numbers would 100+ iterations. 

With 2 macros, a max of 261 iterations would be enough in the macro config, but using a single macro I had to bump the number up to 900,000 (Alteryx did 849,665 iterations in 43 minutes).  Either with 1 or 2 macros however, the same grand total iterations (for all 10,000 numbers) are required.

Additional conclusions:

These are the top 5 most popular number of iterations:

Count iterations
190 52
184 47
175 39
160 44
153 60

And the most iterations needed award goes to....

Spoiler
6171 with 261 iterations!

Additional spoilers..

Spoiler
collatz1.jpgcollatz2.jpg

Workflow and macro spoiler:

Spoiler
collatz3.jpg

 

 

mbens123
8 - Asteroid

I needed the iterative macro practive

Spoiler
WC475 2025-05-09workflow.pngWC475 2025-05-09_it_macro.png
Reesetrain2
9 - Comet
9 - Comet

All,

 

My solution.

The highest number with the least amount of steps is 8192 is just 13 steps!

Spoiler
Screenshot 2025-05-09 182704.pngScreenshot 2025-05-09 182230.png

Screenshot 2025-05-09 182205.png

  

john_knapp
6 - Meteoroid

my solution