Since 504=23.32.7, therefore it is enough to show that p6−1 is a multiple of 23,32and7.
Step 1: Divisibility by 8:
p6−1 is divisible by p2−1. Since p is a prime greater than 7, therefore p−1 and p+1 are both even. Out of the consecutive even integers p−1 and p+1, one must be a multiple of 2 and the other must be a multiple of 4. (In fact, if p−1=4k+2, then p+1=4k+4;
if p−1=4k,thenp+1=4k+2. In either case (p−1)(p+1) is a multiple of 8).
Step 2: Divisibility by 9:
Since the product of three consecutive integers p−1,p,p+1 is divisible by 3,and p is not divisible by 3 (because it is a prime greater than 3), therefore (p−1)(p+1) is divisible by 3.
Now p6−1=(p2−1)(p4+p2+1),
=(p2−1){(p2−1)+3p2}
Since p2−1 is divisible by 3, therefore (p2−1)2+3p2 is also divisible by 3. Consequently p6−1 is divisible by 9.
Step 3: Divisibility by 7:
Since 7 is prime 7 and p is prime to 7 (being a prime greater than 7), therefore by Fermat's theorem p6−1 is multiple of 7.
Since p6−1 is divisible by 8, 9 and 7 and the numbers 8, 9 and 7 are co-prime, therefore it is divisible by 8×9×7,i.e.,504