maths
posted by number theory .
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?

so we need to look at the number before a perfect square and see if it is a prime or not
41 = 3 , 1x3 , 1 is not considered prime
91 = 8 more than 1 pair of factors
161 = 15 > 3x5 , both prime ✔
251 = 24 lots of pairs
361 = 35 > 5x7 , both prime ✔
491 = 48 lots
641 = 63 lots
81  1 = 80 lots
1001 = 99 lots
so the only n values are 4 and 6
and their sum is 10