I would like to start the discussion of integers with a quote.
I would like to write down a good quote that Heinrich Martin Weber attributed to mathematician Leopold Kronecker:
“God made the integers, all else is the work of man”
There’s a book by Stephen Hawking on a history of mathematics titled God Created the Integers: The Mathematical Breakthroughs That Changed History based on this quote.
Integers and other numbers

IntegerDigits

In[]:=
??IntegerDigits

IntegerDigits[n]

A list of decimal digits in the integer 123456789101:
In[]:=
IntegerDigits[123456789101]

IntegerDigits[n,b]

A list of the base 3 digits in the integer 123456789101:
In[]:=
IntegerDigits[123456789101,3]

IntegerDigits[n,b,len]

A list of decimal digits in the integer 123456789101 padded to have 40 digits:
In[]:=
IntegerDigits[123456789101,3,40]

IntegerDigits[n,MixedRadix[blist]]

Use a mixed radix with list of bases {2,7,1,8}
In[]:=
IntegerDigits[123456789101,MixedRadix[{2,7,1,8}]]

IntegerDigits[n,MixedRadix[blist],lenspec]

Use a mixed radix with list of bases {2,7,1,8} padded to have 40 digits:
In[]:=
IntegerDigits[123456789101,MixedRadix[{2,7,1,8}],40]
This usage is not documented but it works to pad with a MixedRadix for IntegerDigits.

Make a function for complex digits

I’m creating a function for ComplexDigits. I think I might implement this as a function for the Function Repository in the future. I think it also be worth submitting a function to test if a number is a complex number named ComplexQ or ComplexNumberQ.
In[]:=
ComplexDigits//ClearAll​​ComplexDigits[n_]/;n∈:=RealDigits/@ReIm[n]
In[]:=
ComplexDigits[RandomComplex[{-100-100I,100+100I}]]
The check stops the function from evaluating for inputs that are not complex:
In[]:=
ComplexDigits[RandomColor[]]
The function works with purely real numbers.
In[]:=
ComplexDigits[1]
Out[]=
{{{1},1},{{0},1}}

RealDigits


FromDigits


IntegerLength


DigitCount

In[]:=
??DigitCount

DigitCount[n,b,d]

In[]:=
DigitCount[123456789101,7,4]

DigitCount[n,b]

In[]:=
DigitCount[123456789101,7]

DigitCount[n]

In[]:=
DigitCount[123456789101]

NumberDigit


IntegerReverse


IntegerExponent


MantissaExponent


IntegerPart


Log10


Log2


NumberExpand

In[]:=
NumberExpand[1234]
In[]:=
??NumberExpand
In[]:=
NumberExpand[1234,3]
In[]:=
NumberExpand[1234,3,10]
In[]:=
NumberExpand[1234,3,13]
Strings

IntegerString

In[]:=
PersistResourceFunction["Arity"]
Out[]=
Success
✓
Message: Successfully stored Arity as an initialization symbol.
PersistenceLocation: PersistenceLocation
Type: Local


In[]:=
Arity[IntegerString]
Out[]=
{{1,3}}
There should be between 1 and 3 arguments for IntegerString. This means IntegerString is a unary (1-argument function), binary, and ternary function. Let’s verify this is the case.
In[]:=
Information[IntegerString]
Out[]=
Symbol
IntegerString[n] gives a string consisting of the decimal digits in the integer n. ​IntegerString[n,b] gives a string consisting of the base-b digits in the integer n. ​IntegerString[n,b,len] pads the string on the left with zero digits to give a string of length len. ​IntegerString[n,MixedRadix[blist]] uses the mixed radix with a list of bases blist.​IntegerString[n,"numsys"] gives the numeral form of n based on the numeric system defined by "numsys".
Documentation
Local »
|
Web »
Attributes
{Listable,Protected}
Full Name
System`IntegerString
​

IntegerString[n]


IntegerString[n,b]


IntegerString[n,b,len]


IntegerString[n,MixedRadix[blist]]

In[]:=
IntegerString[12345,MixedRadix[{4,9,16,25}]]//InputForm
Out[]//InputForm=
33dk
In[]:=
IntegerString[500000,MixedRadix[{4,9,16,25,36}]]//InputForm
Out[]//InputForm=
37bdw

IntegerString[n,MixedRadix[blist],len]

In[]:=
IntegerString[12345,MixedRadix[{4,9,16,25}],40]//InputForm
Out[]//InputForm=
00000000000000000000000000000000000033dk
In[]:=
IntegerString[500000,MixedRadix[{4,9,16,25,36}],40]//InputForm

IntegerString[n,”numsys”]

Armenium

“ArmenianLower”

Bengali

Chinese

Devanagari

Ethiopic numerals

Georgian numerals

Greek numerals

lowercase Greek numerals

Gurmukhi numerals used in Punjabi language

Hebrew numerals

Japanese numerals

Japanese financial

Kayah Li numerals

That’s not good. I can’t read the characters.

Malayalam numerals

N’ko

Oriya, also known as Odia, numerals

Roman numerals

Roman numerals that use only Unicode characters

lowercase Roman numerals

Simplified Chinese numerals

Simplified Chinese numerals used for financial purposes

Tai numerals

Tamil numerals

base-10 Tamil numerals

Tao, also known as Yami, numerals

Telugu numerals

Thai numerals

Tibetan numerals

numerals used in Traditional Chinese

numerals used in Traditional Chinese calendars

base-10 Traditional Chinese numerals

Traditional Chinese numerals used for financial purposes

base-58 digits with Bitcoin encoding alphabet

base-64 digits with Bsae64 encoding alphabet