Posted by Ian on .
What is the sum of all integer values of n satisfying 1≤n≤100, such that n2−1 is a product of exactly two distinct prime numbers?
Since n^2-1 = (n-1)(n+1) you want to find all the twin primes whose geometric mean is at most 1000.
Consult any list of twin primes.
For example, 29,31: n=30 and 899 = 29*31
So, if you find the list of twin primes (n-1),(n+1) less than 10,000 add up all the values of n.