That seems like an easy interview question.
That seems like an easy interview question.
Or you could algebraically bash it out.
If n is prime>3 then it's definitely odd.
n^2-1 = (n+1).(n-1)
But n is odd, so (n+1) and (n-1) are both even. So overall, we have a factor of 4.
But, since one of those two is 2 different from the other, it must also be divisible by 4.
Now, looking at this sideways too, we also have a run of 3 numbers {(n-1), n, (n+1)}. So one of them must be divisible by 3. But n isn't (since it's prime). Therefore at least one of the other two is.
So,overall, we have 2.4.3 as a minimum set of factors...
edit: I sincerely hope you were making a joke.
That's a fairly easy question as well. Every single person in my immediate vicinity knows it. My daughter who is less than 36 months old knows it.
Don't you?