Home
Help
Search
Login
Register
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Lab Minutes Forum
»
Technical Discussion
»
Other
»
Puzzle
Search
User Info
Username:
Password:
1 Hour
1 Day
1 Week
1 Month
Forever
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
« previous
next »
Print
Pages: [
1
]
Author
Topic: Puzzle (Read 17405 times)
rthurber
Guest
Puzzle
«
on:
August 21, 2013, 09:53:25 PM »
Prove that the following program always terminates for any positive integer
sub doIterminate($count) {
$num = int($count);
while($num != 1) {
if(($num%2) == 0) {
$num = $num/2;
} else {
$num = 3 * $num + 1;
}
}
}
Logged
Print
Pages: [
1
]
« previous
next »
Lab Minutes Forum
»
Technical Discussion
»
Other
»
Puzzle
SimplePortal 2.3.7 © 2008-2024, SimplePortal