primes here can end in 1,2,4,5,7 and 8. because 9 is 3x3 its like a more advanced base 3
credits to rodolfo emilp1706_number_2 and aaron