I tried that but it didn't work......
--- Update ---
*it didn't help
Type: Posts; User: leeminho
I tried that but it didn't work......
--- Update ---
*it didn't help
Well my problem is that when i run my program, it keeps printing out 2 as the answer but the answer should be 8111. So i probably messed up with while(Sn != 472151 )
public static void question3()
{
/*
1. S(n) stands for the sum of all the numbers in the Hailstone sequence beginning with n. For example, S(6) = 55 and
S(7) = 288. For what integer...
public static void question3()
{
1. S(n) stands for the sum of all the numbers in the Hailstone sequence beginning with n. For example, S(6) = 55 and
S(7) = 288. For what integer n...
If n is even, the next integer is n/2.
If n is odd, the next integer is 3n+1.
--- Update ---
this is my method so far...
public static void question3()
{
/*
1. S(n) stands for...
This is the task:
This puzzle involves sequences of integers known as Hailstone sequences. A Hailstone sequence begins with any positive integer and continues until it reaches 1. When a positive...