Example

Now, check to see if all primes divide 627.

If 0,2,4,6,8| the last digit, then 2|627

If , then 3|627.

For 5, the last digit needs to be 0 or 5.

For 7, double the last digit 7*2=14 and subtract it from the remaining digits 62-14=48, and if 7|48, then 7|627.

For 11, subtract the last digit from the remaining digits 62-7=55, and if 11|55 which it does, then 11|627.

For 13, add 4 times the last digit 62+28=90, and if 13|90, then 13|627.

I only know rules for up to 13.