Want to get involved? We're always looking for ideas and content for Weekly Challenges.
SUBMIT YOUR IDEA
Hi Community members,
A solution to last week’s challenge can be found here.
This challenge for the mathematicians at heart was submitted by Ippei Nakagawa (@gawa). Thank you, Ippei, for this challenge!
The Collatz conjecture, also known as the 3n + 1 problem, is a conjecture in mathematics named after Lothar Collatz, who introduced it in 1937. It is an unsolved problem in mathematics that is simple to state but difficult to prove. The problem is defined as follows:
Here is an example:
Start with N=6:
A total of 8 steps were required in this example.
For this challenge, you need to create an iterative macro that simulates the repeated steps until reaching 1 for each number. Once the macro is created, your tasks are to:
Need a refresher? Review the following lessons in Academy to gear up:
Good luck!
The Academy Team
Here's my take
I always enjoy the mathematical challenges!
Macro:
Quick tip for this challenge: I'd suggest keeping the number of iterations below 500.
I just tried generating 1,000,000 records and allowed for 1,000,000 iterations, but the last 432 records were not quite ready to be tackled using this routine. The last row that exited the program took less than 500 steps
C475
I loved this challenge, thank you so much! It was fun to build an iterative macro for this mathematical conjecture, in fact.
My workflow and macro are included.