Hello Bunuel - thank you so much for this fantastic post!
with regards to checking for primality:
Verifying the primality (checking whether the number is a prime) of a given number can be done by trial division, that is to say dividing by all integer numbers smaller than , thereby checking whether is a multiple of .
Example: Verifying the primality of : is little less than , from integers from to , is divisible by , hence is not prime.
Would it be accurate to say that a number is prime ONLY if it gives a remainder of 1 or 5 when divided by 6?
i.e, for eg. 10973/6 gives a remainder of 5, so it has to be prime...
i found the reasoning behind this in one of the OG solutions:
prime numbers always take the form: 6n+1 or 6n+5 ....
the only possible remainders when any number is divided by 6 are [0,1,2,3,4,5] ...
A prime number always gives a remainder of 1 or 5, because:
a) if the remainder is 2 or 4, then the number must be even
b) if the remainder is 3, then it is divisible by 3 ...
hence, if a number divided by 6 yields 1 or 5 as its remainder, then it must be prime