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

4-1 = 3 , 1x3 , 1 is not considered prime
9-1 = 8 more than 1 pair of factors
16-1 = 15 --> 3x5 , both prime ✔
25-1 = 24 lots of pairs
36-1 = 35 --> 5x7 , both prime ✔
49-1 = 48 lots
64-1 = 63 lots
81 - 1 = 80 lots
100-1 = 99 lots

so the only n values are 4 and 6
and their sum is 10