(Help) Quotient summation with prime numbers

Hi. I'm writing a program that calculates the product of a summation with the formula of (1 + (1/a prime number squared)). This summaton continues until the number in the denominator reaches the user-specified prime number *n*.

I have a picture demonstrating this here:

http://fc27.deviantart.com/fs34/f/20...5973820f48.jpg

I just know how to calculate a prime number as a boolean value from class, using

Code:

`for (int d = 2; d<=n-1; d++) {`

if (n%d==0) {

isPrime=false

Can I apply that to calculate all the prime numbers up until *n*? I've been to the Java Tip topic "Computing Prime Numbers", but that uses things we haven't used in class yet, like long and arrays.

I've learned from my previous topic that a summation like this uses the *for* and *do* statements, but I can't figure out how to apply them to this problem. Please help.