Friday, July 14, 2006

Number Magic

Guess a positive integer n

if (n is even) {
n = n/2
} else { /* n is odd */
n = 3n + 1
}

Apply this process repeatedly.
This process will always reach the number 1

Eg : 6 -- 3 -- 10 -- 5 -- 16 -- 8 -- 4 -- 2 -- 1

This is Collatz conjecture and remains open till date !!

No comments: