Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Compute the multiplicative digital root, in any base, of an integer
ResourceFunction["MultiplicativeDigitalRoot"][n,b] gives the multiplicative digital root of the non-negative integer n when expressed in the base b. | |
ResourceFunction["MultiplicativeDigitalRoot"][n] gives the base-10 muliplicative digital root of n. |
Compute the multiplicative digital root of 1191:
In[1]:= | ![]() |
Out[1]= | ![]() |
Compute the additive digital root of 1191, base-14:
In[2]:= | ![]() |
Out[2]= | ![]() |
MultiplicativeDigitalRoot threads elementwise over lists:
In[3]:= | ![]() |
Out[4]= | ![]() |
In[5]:= | ![]() |
Out[5]= | ![]() |
Compute the multiplicative digital root of the first 100 integers (OEIS A031347):
In[6]:= | ![]() |
Out[6]= | ![]() |
The result returned by MultiplicativeDigitalRoot can be iteratively computed using NestWhileList:
In[7]:= | ![]() |
Out[7]= | ![]() |
The number of iterations required to reach the end of the digit multiplication process is called the multiplicative persistence and is returned by the resource function MultiplicativePersistence:
In[8]:= | ![]() |
Out[8]= | ![]() |
In[9]:= | ![]() |
Out[9]= | ![]() |
In[10]:= | ![]() |
Out[10]= | ![]() |
In[11]:= | ![]() |
Out[11]= | ![]() |
The additive analogue of the multiplicative digital root is called the additive digital root and is returned by the resource function AdditiveDigitalRoot:
In[12]:= | ![]() |
Out[12]= | ![]() |
In[13]:= | ![]() |
Out[13]= | ![]() |
In[14]:= | ![]() |
Out[14]= | ![]() |
MultiplicativeDigitalRoot requires its input to be non-negative:
In[15]:= | ![]() |
Out[15]= | ![]() |
Create a OEIS-themed table showing which integers have the same multiplicative digital root. This partially reproduces a cool result from the associated MathWorld article:
In[16]:= | ![]() |
Out[16]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License