# Wolfram Language & System 10.4 (2016)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.
BUILT-IN WOLFRAM LANGUAGE SYMBOL

# DigitCount

DigitCount[n,b,d]
gives the number of d digits in the base-b representation of n.

DigitCount[n,b]
gives a list of the numbers of , , , , digits in the base-b representation of n.

DigitCount[n]
gives a list of the numbers of , , , , digits in the base-10 representation of n.

## DetailsDetails

• Integer mathematical function, suitable for both symbolic and numerical manipulation.
• DigitCount[n] is equivalent to DigitCount[n,10,Mod[Range[10],10]].

## ExamplesExamplesopen allclose all

### Basic Examples  (3)Basic Examples  (3)

Binary representation:

 In[1]:=
 Out[1]=

Number of 1s in binary representation:

 In[2]:=
 Out[2]=

Number of 1s and 0s:

 In[3]:=
 Out[3]=

Number of each digit 1, 2, 3, ..., 0 in 100!:

 In[1]:=
 Out[1]=

Plot the number of 1s in the base-2 representation:

 In[1]:=
 Out[1]=

## TutorialsTutorials

Introduced in 1999
(4.0)