Thanks for very clear algorithm. The answer is correct when I don't put factorial "!" into my calculator(18.07950938), but when I put "!" in the calculator it gives me a different answer with the code you helped me out with.

Does the "!" play role?

Code:

public class AnotherTry

{

public static void main (String [] args)

{

int maxI = 10;

int n = 0;

long nPerm = 1;//n

long nPlus1Perm = 1;//(n+1)

double sum = 0;

for (int i = 0; i < maxI; i++)

{

n = i + 1;

nPerm = nPlus1Perm;

nPlus1Perm = nPlus1Perm *(n+1);

double prod = (n + 5.0) / (n+1.0);

sum += prod;

}

System.out.println("sum: " + sum);

}

}

Thanks a lot for your support!!! I am just a little bit confused here

--- Update ---

I've finally got where I have made a mistake! My code was correct but the instructions in the loop weren't ordered on the right place.

Here is a code:

/**
*Question #2
*/
public class Sum
{
public static void main (String [] args)
{
long a = 1;
long b = 2 * a;
double sum = (a + 5.0) / b;
long n = 3;
while(n<=11)
{
a = a * (n - 1);
b = n * b;
sum = sum + (double)(a + 5.0) / b;
n++;
}//end of a loop
System.out.println("The answer is " + sum);
}
}

The output is 5.611286475869809 as it should be.

Thanks for the effort anyway!