General Divisibility Criteria
  We believe we have made progress in the age-old problem of divisibility rules for integers. Universal divisibility rule is introduced for any divisor in any base number system. The divisibility criterion is written down explicitly as a linear form in the digits of the test number. The universal criterion contains only two parameters that depend on the divisor and are easily calculated. These divisibility parameters are not unique for a given divisor but each two-parameter set yields a unique criterion. Well-known divisibility rules for exemplary divisors in the decimal system follow from the universal expression as special cases. 
Anatoly A. Grinberg and Serge Luryi
math.GM