TOPICS
Search

Digit


The number of digits D in an integer n 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-b digits in a number n can be calculated as

 D_b(n)=1+|_log_b|n|_|,
(1)

where |_x_| is the floor function. For b=10, the formula becomes

 D_(10)(n)=1+|_log_(10)|n|_|.
(2)

The number of digits d in the number n represented in base b 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 n. 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 n-digit integers is given by

N(n)=10·9...(11-n)-9·8...(11-n)
(3)
=(10-1)9...(11-n)
(4)
=9(10-n)_n
(5)
=(9·9!)/((10-n)!),
(6)

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

sum_(n=1)^(10)N(n)=9sum_(n=1)^(10)(10-n)_n
(7)
=8877690
(8)

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

S=(6745140117...4801548051_()_(14816583 digits))/(75533922310...8000000000_()_(14816583 digits))
(9)
=8.92994817475544342417...
(10)

(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).

borderOEISNumbers (>=b)
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-b is 2^(b-1), and the number with strictly decreasing digits is 2^b-1.


See also

196-Algorithm, Additive Persistence, Digit Count, Digit Product, Digit Sum, Digit-Shifting Constants, Digitaddition, Digital Root, Factorion, Figures, Harshad Number, Katadrome, Metadrome, Multiplicative Persistence, Narcissistic Number, Nialpdrome, Number Length, Plaindrome, Scientific Notation, Significant Digits, Smith Number, Sum-Product Number

Related Wolfram sites

http://functions.wolfram.com/NumberTheoryFunctions/DigitCount/

Explore with Wolfram|Alpha

References

Bailey, D. H. and Crandall, R. E. "On the Random Character of Fundamental Constant Expansions." Exper. Math. 10, 175-190, 2001. http://www.nersc.gov/~dhbailey/dhbpapers/baicran.pdf.Foregger, T. "Helping Professor Umbugio. Solution to Problem E2533." Amer. Math. Monthly 83, 570-571, 1976.Pondiczery, E. S. "Problem E2533." Amer. Math. Monthly 82, 401, 1975.Sloane, N. J. A. Sequences A005349/M0481, A009993, A009994, A009995, A009996, A010784, A023757, A023758, A023771, A023784, A023797, A034838, A038369, A050104, A073531, and A117914 in "The On-Line Encyclopedia of Integer Sequences."

Referenced on Wolfram|Alpha

Digit

Cite this as:

Weisstein, Eric W. "Digit." From MathWorld--A Wolfram Web Resource. https://mathworld.wolfram.com/Digit.html

Subject classifications