TOPICS
Search

Digit


A digit is a symbol used to represent a number in a given base. Decimal digits are the ten symbols 0 through 9 used in the decimal numeral system, while binary digits are the two symbols 0 and 1 used in binary. Their positions determine place values in a decimal expansion or binary expansion, respectively.

The number of digits D in an integer n is the number of symbols in that 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. For a nonzero integer n and an integer base b>=2, the number of base-b digits can be calculated as

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

where |_x_| is the floor function. The number 0 is represented by one digit. For b=10, the formula becomes

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

The number of occurrences of the digit 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 nonzero integer is given by IntegerLength[n, b]. The function IntegerLength[0] returns 0, although the representation of 0 has one digit.

For any fixed integer base b>=2 and any specified digit d with 0<=d<b, almost all positive integers contain d in their base-b representation. There are (b-1)b^(k-1) positive integers with k>=1 digits, of which at most (b-1)^k omit d. If N has K digits, then b^(K-1)<=N<b^K, and at most K(b-1)^K of the first N positive integers omit d. Their proportion is therefore at most bK(1-1/b)^K, which tends to 0 as K->infty. The decimal digit 3 is an illustrative case (Numberphile 2012).

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 positive integers with distinct digits is given, for 1<=n<=10, by

N(n)=(10!)/((10-n)!)-(9!)/((10-n)!)
(3)
=((10-1)9!)/((10-n)!)
(4)
=9(11-n)_(n-1)
(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)(11-n)_(n-1)
(7)
=8877690
(8)

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

The sum 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_()_(14816582 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 A051004). The positive integers equal to the product of their decimal digits multiplied by the sum of those digits are called sum-product numbers. They are exactly 1, 135, and 144. The sequence OEIS A038369 also includes 0, which satisfies the same digit equation.

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, ...
16nonincreasingA02377116, 17, 32, 33, 34, 48, 49, 50, 51, 64, 65, 66, ...
16decreasingA02379716, 32, 33, 48, 49, 50, 64, 65, 66, 67, 80, 81, ...

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

Counting 0 as a one-digit number, the count of nonnegative integers 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, Binary Digit, Decimal Digit, Digit Count, Digit Product, Digit-Shifting Constants, Digit Sum, 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

https://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. https://doi.org/10.1080/10586458.2001.10504441.Foregger, T. "Helping Professor Umbugio. Solution to Problem E2533." Amer. Math. Monthly 83, 570-571, 1976.Numberphile. "3 Is Everywhere." Apr. 1, 2012. https://www.youtube.com/watch?v=UfEiJJGv4CE.Pondiczery, E. S. "Problem E2533." Amer. Math. Monthly 82, 401, 1975.Sloane, N. J. A. Sequences A000225, A005349/M0481, A009993, A009994, A009995, A009996, A010784, A023757, A023758, A023771, A023784, A023797, A034838, A038369, A051004, 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 Resource. https://mathworld.wolfram.com/Digit.html

Subject classifications