Skip to content

Commit c09e820

Browse files
committed
split into introduction and instructions
1 parent eec1a6c commit c09e820

File tree

3 files changed

+28
-29
lines changed

3 files changed

+28
-29
lines changed

exercises/collatz-conjecture/description.md

Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Instructions
2+
3+
Given a positive integer, return the number of steps required to reach 1.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Introduction
2+
3+
One evening, we found an old notebook filled with scribbles, like someone had been chasing a strange idea.
4+
On one page, there was a single question: **Can every number find its way to 1?**
5+
It was tied to something called the Collatz Conjecture, a puzzle that has baffled thinkers for decades.
6+
7+
The instructions seemed simple.
8+
Pick any positive integer:
9+
10+
* If it's even, divide it by 2.
11+
* If it's odd, multiply it by 3 and add 1.
12+
13+
Then, repeat these steps with the result, continuing indefinitely.
14+
15+
Curious, we picked number 12 to test, and started the journey:
16+
17+
12 ➜ 6 ➜ 3 ➜ 10 ➜ 5 ➜ 16 ➜ 8 ➜ 4 ➜ 2 ➜ 1
18+
19+
Counting from the second number (6), it took 9 steps to reach 1, and each time the rules repeated, the number kept changing.
20+
At first, the steps seemed unpredictable — jumping up, down, and all over — yet they always ended at 1, no matter the starting number.
21+
22+
It was fascinating, but also puzzling.
23+
Why does this always seem to work?
24+
Could there be a number where the process breaks down, looping forever or escaping into infinity?
25+
No one knows for sure.

0 commit comments

Comments
 (0)