In mathematics a **polydivisible number** (or **magic number**) is a number with digits *abcdef...* that has the following properties :

- Its first digit
*a*is not 0. - The number formed by its first two digits
*ab*is a multiple of 2. - The number formed by its first three digits
*abc*is a multiple of 3. - The number formed by its first four digits
*abcd*is a multiple of 4. - etc.

For example, EX9876 is a six-digit polydivisible number, but 123456 is not, because 12345 is not a multiple of 5. Polydivisible numbers can be defined in any base - however, the numbers in this article are all in base 10, so permitted digits are 0 to E.

There are 71823 polydivisible numbers, and the largest of them is 24-digit 6068,903468,50EX68,00E036,206464

If *k* is a polydivisible number with *n*-1 digits, then it can be extended to create a polydivisible number with *n* digits if there is a number between 10*k* and 10*k*+E that is divisible by *n*. If *n* is less or equal to 10, then it is always possible to extend an (*n*-1)-digit polydivisible number to an *n*-digit polydivisible number in this way, and indeed there may be more than one possible extension. If *n* is greater than 10, it is not always possible to extend a polydivisible number in this way, and as *n* becomes larger, the chances of being able to extend a given polydivisible number become smaller (e.g. for *n*=14, the chance is 90%, while for *n*=20, the chance is only 60%). On average, each polydivisible number with *n*-1 digits can be extended to a polydivisible number with *n* digits in 10/*n* different ways. This leads to the following estimate for *F(n)* :

*F*(*n*) ≈ (E*10^(*n*-1))/(*n*!)

Summing over all values of *n*, this estimate suggests that the total number of polydivisible numbers will be approximately

E*(*e*^10-1)/10 ≈ 72407

where *e* = 2.875236069822... is the base of natural logarithm.

There are about E*10^(*n*-1)/*n*! *n*-digit polydivisible numbers.

There are no E-digit polydivisible numbers using all the digits 1 to E exactly once. (hence there are also no 10-digit polydivisible numbers using all the digits 0 to E exactly once)