[proxy] web.archive.org← back | site home | direct (HTTPS) ↗ | proxy home | ◑ dark◐ light

Digit

Weisstein, Eric W.

The Wayback Machine - https://web.archive.org/web/20200318173207/https://mathworld.wolfram.com/Digit.html


The number of digits in an integer is the number of numbers in some base (usually 10) required to represent it. The numbers 1 to 9 are therefore single digits, while the numbers 10 to 99 are double digits. Terms such as "double-digit inflation" are occasionally encountered, although this particular usage has thankfully not been needed in the U.S. for some time. The number of base- digits in a number can be calculated as

(1)

where is the floor function. For , the formula becomes

(2)

The number of digits in the number represented in base is given by the Wolfram Language function DigitCount[n, b, d], with DigitCount[n, b] giving a list of the numbers of each digit in . The total number of digits in a number is given by IntegerLength[n, b].

The positive integers with distinct base-10 digits are given by 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, ... (OEIS A010784). The number of -digit integers is given by

(3)

(4)

(5)

(6)

where is a Pochhammer symbol. For , 2, ..., the first few values are 9, 81, 648, 4536, 27216, 136080, 544320, 1632960, 3265920, and 3265920 (OEIS A073531). There are therefore exactly

such numbers (Pondiczery 1975-a pseudonym for Ralph P. Boas; Foregger 1976), the largest of which is 9876543210.

The sums of the reciprocals of these 8877690 integers (Pondiczery 1975, Foregger 1976) is a rational number with numerator having 14816583 digits and denominator having 14816582 digits and given by

(OEIS A117914), computed by E. W. Weisstein on Apr. 1, 2006 using gridMathematica.

Numbers in base-10 which are divisible by their digits are 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 15, 22, 24, 33, 36, 44, 48, 55, 66, 77, 88, 99, 111, 112, 115, 122, ... (OEIS A034838). Numbers which are divisible by the sum of their digits are called Harshad numbers: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 18, 20, 21, 24, ... (OEIS A005349). Numbers which are divisible by both their digits and the sum of their digits are 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, 36, 48, 111, 112, 126, 132, 135, 144, ... (OEIS A050104). Numbers which are equal to (i.e., not just divisible by) the product of their divisors and the sum of their divisors are called sum-product numbers and are given by 1, 135, 144, ... (OEIS A038369).

orderOEISNumbers ()
2increasing
2nondecreasingA0002253, 7, 15, 31, 63, 127, 255, 511, 1023, ...
2nonincreasingA0237582, 3, 4, 6, 7, 8, 12, 14, 15, 16, 24, 28, 30, 31, ...
2decreasing2
10increasingA00999312, 13, 14, 15, 16, 17, 18, 19, 23, 24, 25, 26, ...
10nondecreasingA00999411, 12, 13, 14, 15, 16, 17, 18, 19, 22, 23, 24, ...
10nonincreasingA00999610, 11, 20, 21, 22, 30, 31, 32, 33, 40, 41, 42, ...
10decreasingA00999510, 20, 21, 30, 31, 32, 40, 41, 42, 43, 50, 51, ...
16increasingA02378418, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, ...
16nondecreasingA02375717, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, ...
16nonincreasingA02377117, 32, 33, 34, 48, 49, 50, 51, 64, 65, 66, 67, ...
16decreasingA02379732, 33, 48, 49, 50, 64, 65, 66, 67, 80, 81, 82, ...

In hexadecimal, numbers with increasing digits are called metadromes, those with nondecreasing digits are called plaindrones, those with nonincreasing digits are called nialpdromes, and those with decreasing digits are called katadromes.

The count of numbers with strictly increasing digits in base- is , and the number with strictly decreasing digits is .

Wolfram Web Resources

Mathematica »

The #1 tool for creating Demonstrations and anything technical.

Wolfram|Alpha »

Explore anything with the first computational knowledge engine.

Wolfram Demonstrations Project »

Explore thousands of free applications across science, mathematics, engineering, technology, business, art, finance, social sciences, and more.

Computerbasedmath.org »

Join the initiative for modernizing math education.

Online Integral Calculator »

Solve integrals with Wolfram|Alpha.

Step-by-step Solutions »

Walk through homework problems step-by-step from beginning to end. Hints help you try the next step on your own.

Wolfram Problem Generator »

Unlimited random practice problems and answers with built-in Step-by-step solutions. Practice online or make a printable study sheet.

Wolfram Education Portal »

Collection of teaching and learning tools built by Wolfram education experts: dynamic textbook, lesson plans, widgets, interactive Demonstrations, and more.

Wolfram Language »

Knowledge-based programming for everyone.