This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
 BUILT-IN MATHEMATICA SYMBOL Tutorials »| See Also »| More About »

# IntegerDigits

 IntegerDigits[n]gives a list of the decimal digits in the integer n. IntegerDigitsgives a list of the base b digits in the integer n. IntegerDigitspads the list on the left with zeros to give a list of length len.
• IntegerDigits gives the most significant digit first, as in standard positional notation.
• If len is less than the number of digits in n then the len least significant digits are returned.
Find digits in base 10:
Find digits in base 2:
Find digits in base 10:
 Out[1]=

Find digits in base 2:
 Out[1]=
 Scope   (6)
Bases larger than 10 can be used:
IntegerDigits threads itself over elements of lists:
Find the digits of 7 in different bases:
By default, IntegerDigits includes no leading zeros:
Pad all digit lists to be length 3:
Find only the last 4 digits:
 Applications   (3)
Leading digits of factorials:
ChampernowneNumber has a decimal expansion that is a concatenation of consecutive integers:
Compare to ChampernowneNumber:
Cantor set construction:
Find all combinations of 3 binary digits:
Pad digit lists to be the same length:
The sign is ignored:
Leading digits of factorials in base 100:
New in 2 | Last modified in 5