← back to unit
Medium
# puzzle gauntlet medium
The Collatz Ride
The strangest ride in mathematics: even numbers get halved, odd numbers become 3n+1. Every number ever tested eventually crashes into 1 — nobody on Earth has proven they all must! 🎢
You get a starting n. Print how many steps the ride takes to reach 1.
Example:
Input: n = 6
Output: 8
The ride goes 6 → 3 → 10 → 5 → 16 → 8 → 4 → 2 → 1 — that's 8 steps to reach 1.
💡 need a hint?
pg-collatz-ride.py🔒 given lines are locked — write your code in between
loading...