I have also never seen this formula before, but as we all know, prime numbers have some very creative tricks and rules associated with them. Since the number resulting from this formula will always be a factor of 24 then that means that the answer to (P^2)-1 will always have 3 factors of 2 and 1 factor of 3 (aka 3 * 2^3).
Prime numbers will always be odd, and a prime number ^2 will also always be odd. So to subtract one from that number will always give you an even number. Since the prime number has be to greater than 5, then the lowest number this formula will yield is 48. Any even number great than 4 that does not have 2 and a prime number as its only factor will always have at least 3 factors of 2. So the last number that has to be dealt with to explain this formula is the last factor of 3. As you can see below, every number is divisible by 3 which explains this. Unfortunately, I can not figure out why this formula will always yield a number divisible by 3. Does anyone else have any insight? Very interesting one.
7^2 = 49 - 1 = 48
11^2 = 121 - 1 = 120
13^2 = 169 - 1 = 168
17^2 = 289 - 1 = 288
19^2 = 361 - 1 = 360
23^2 = 529 - 1 = 528
29^2 = 841 - 1 = 840
To me, this formula is just one of the "it is what it is" type formulas. The proof could be very complicated, and in fact be no real help to you on test day. My advice is to commit this formula to memory, and if you see anything to do with this on test day, you will be golden. Most likely you will not see anything referring to this formula, but the more tricks, tips, patterns, and secrets like these you know, the more time you can save and the higher score you can achieve.