squares of primes

my friend at CTY told me something absolutely trippy: every single prime number greater than 3, when squared, is one more than a multiple of 24. i'm dead serious. think of any prime number.

5^2 = 25 = (1 * 24) + 1

7^2 = 49 = (2 * 24) + 1

11^2 = 121 = (5 * 24) + 1

it's wild. primes are supposed to be totally random, but for some reason their squares start behaving around 24. why is this true?

unfortunately, it's not as cool as it looks. this isn't really a cool thing about primes, it's a cool thing about numbers that aren't divisible by 3.

to understand this, we need to understand the modulo function (which is linked above)Â