What is the sum of all integer values of n satisfying 1 \leq n \leq 100, such that n^2 - 1 is a product of exactly two distinct prime numbers?

since n^2-1 = (n-1)(n+1) we are looking for twin primes

Just look up a list of twin primes, and sum their average (since you want the even number n between n-1 and n+1)

To find the sum of all integer values of n satisfying the given condition, we need to check each value of n within the given range (1 ≤ n ≤ 100).

First, let's consider the expression n^2 - 1. We can rewrite it as (n - 1)(n + 1).

For this expression to be a product of exactly two distinct prime numbers, both (n - 1) and (n + 1) must be prime.

To solve this problem efficiently, we can follow these steps:

1. Create a list of prime numbers less than or equal to \sqrt{100} (10). This list will help us verify if a number is prime.

2. Initialize a variable, let's call it "sum_n," to keep track of the sum of all integer values of n satisfying the condition. Set it to zero.

3. Loop through each value of n starting from 2 (since 1 is not prime) up to 100.

4. Inside the loop, check if n minus 1 and n plus 1 are both prime numbers. To do this, iterate over the list of primes created in step 1. If both (n - 1) and (n + 1) are not prime, move on to the next value of n.

5. If both (n - 1) and (n + 1) are prime numbers, add n to the "sum_n" variable.

6. After the loop completes, "sum_n" will contain the sum of all integer values of n satisfying the condition.

Implementing these steps in code will give us the desired result.