There are same ways, they are used to find a property of divisibility.
There are codes, which way we move.
Some of them depend just from positional systems [PS] (link).
The divisor equal to base of positional system has least significiant digit 0. Such ordinary case will not present in posts.
Example:
P = 16
Number N = 0xFDE87563932145BAC0 is divisible by P=16.
There are few methods to find a rule. One method decrease base [PD] (link) to get divisor, the second increase base [PU] (link). These methods return quotient as well as remainder, when they are used wisely.
Another way uses linear combination with congruence [SF] (link).
Some of rules depend on special number [SN], it has nice properties.
Conversion [CR] (link) is often used, especially it changed the power of base of positional system P. This allows find rules for much bigger numbers.
If You don't find rule from any system P, try check the rule from system P^2 or other powers.
The rule for composite number:
' N=p*q iff N divisible by p and q '
is mentioned only here.