NegativeDigitalRoot
Author
Paul F. Marrero Romero
Title
NegativeDigitalRoot
Description
This Mathematica function can compute the negative digital root of any negative integer
Category
Working Material
Keywords
digital root, algorithm, mathematica, wolfram package, negative digital root, number theory, roots, functions
URL
http://www.notebookarchive.org/2024-12-2d71k56/
DOI
https://notebookarchive.org/2024-12-2d71k56
Date Added
2024-12-05
Date Last Modified
2024-12-05
File Size
98.71 kilobytes
Supplements
Rights
CC BY 4.0
Download
Open in Wolfram Cloud
NegativeDigitalRoot
NegativeDigitalRoot
Paul F. Marrero Romero
Compute the negative digital root of any negative integer
Definition
Definition
In[]:=
Attributes[NegativeDigitalRoot]={Listable};
In[]:=
NegativeDigitalRoot[n_?(IntegerQ[#]&&#<0&)]:=n-(-9)*Floor[(n+1)/-9]NegativeDigitalRoot[_]:=Message[Error::InvalidInput]Error::InvalidInput="The provided input is not a negative integer.";
Documentation
Documentation
Usage
Usage
NegativeDigitalRoot[n]
gives the negative digital root for the negative integer .
n
Details & Options
Details & Options
Consider a negative integer n,
when n < 0 the negative digital root of n is:
■ NegativeDigitalRoot[n] = n - (-9) * Floor[(n+1) / -9],
when n < 0 the negative digital root of n is:
■ NegativeDigitalRoot[n] = n - (-9) * Floor[(n+1) / -9],
As an example, consider n = -476:
■ NegativeDigitalRoot[-476] = (-476) - (-9) * Floor[(-476 + 1) / -9] = -8.
■ NegativeDigitalRoot[-476] returns -8.
■ NegativeDigitalRoot[-476] = (-476) - (-9) * Floor[(-476 + 1) / -9] = -8.
■ NegativeDigitalRoot[-476] returns -8.
For any negative integer n:
■ 0 > NegativeDigitalRoot[n] ≥ - 9.
■ 0 > NegativeDigitalRoot[n] ≥ - 9.
NegativeDigitalRoot threads elementwise over lists.
Examples
Examples
Basic Examples
Basic Examples
Compute the negative digital root of - 476 :
In[]:=
NegativeDigitalRoot[-476]
Out[]=
-8
Scope
Scope
NegativeDigitalRoot
In[]:=
ListNint={-123,-851,-43256,-9957412};NegativeDigitalRoot[ListNint]
Out[]=
{-6,-5,-2,-1}
Compute the negative digital root of the terms that belong to the integer sequence A123183-OEIS and generate a new integer sequence:
In[]:=
A123183={-1,-1,-2,-5,-14,-41,-122,-365,-1094,-3281,-9842,-29525,-88574,-265721,-797162,-2391485,-7174454,-21523361,-64570082,-193710245,-581130734,-1743392201,-5230176602,-15690529805,-47071589414,-141214768241,-423644304722,-1270932914165,-3812798742494};
In[]:=
NegativeDigitalRoot[A123183]
Out[]=
{-1,-1,-2,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5}
The following tabulation illustrates the values of the negative digital root applied to each term of the sequence A123183-OEIS:
In[]:=
x=A123183;y=NegativeDigitalRoot[A123183];TableForm[{x,y},TableDirectionsRow,TableHeadings{{"A123183","NDR(A123183)"}}]
Out[]//TableForm=
A123183 | NDR(A123183) |
-1 | -1 |
-1 | -1 |
-2 | -2 |
-5 | -5 |
-14 | -5 |
-41 | -5 |
-122 | -5 |
-365 | -5 |
-1094 | -5 |
-3281 | -5 |
-9842 | -5 |
-29525 | -5 |
-88574 | -5 |
-265721 | -5 |
-797162 | -5 |
-2391485 | -5 |
-7174454 | -5 |
-21523361 | -5 |
-64570082 | -5 |
-193710245 | -5 |
-581130734 | -5 |
-1743392201 | -5 |
-5230176602 | -5 |
-15690529805 | -5 |
-47071589414 | -5 |
-141214768241 | -5 |
-423644304722 | -5 |
-1270932914165 | -5 |
-3812798742494 | -5 |
Properties and Relations
Properties and Relations
The sum of the negative digital roots of two negative integers n,m is congruent to the negative digital root of the sum of those two integers, modulo -9, i.e., -9 | NDR(n + m) - (NDR(n) + NDR(m)):
In[]:=
With[{n=RandomInteger[-10^11],m=RandomInteger[-10^11]},Divisible[NegativeDigitalRoot[n+m]-(NegativeDigitalRoot[n]+NegativeDigitalRoot[m]),-9]]
Out[]=
True
The negative digital root can be computed using a closed formula in terms of :
Mod
In[]:=
With[{n=RandomInteger[-10^11]},NegativeDigitalRoot[n]==Mod[n+1,-9]-1]
Out[]=
True
Possible Issues
Possible Issues
NegativeDigitalRoot requires its input to be a negative integer:
In[]:=
NegativeDigitalRoot[498576]
::InvalidInput
Source & Additional Information
Source & Additional Information
Contributed By
Contributed By
Paul F. Marrero Romero
Keywords
Keywords
◼
negative digital root
◼
modular arithmetic
◼
integers
◼
floor function
Categories
Categories
Links
Links
Author Notes
Author Notes
The function in question is applicable solely to negative integers. In the event that the objective is to utilize it with non-negative integers, it is recommended to seek the function designated as “AdditiveDigitalRoot” at the Wolfram Resource System.
Acknowledgements This Mathematica function is the result of research conducted in the field of discrete mathematics at the Marrero Research Lab.
Acknowledgements This Mathematica function is the result of research conducted in the field of discrete mathematics at the Marrero Research Lab.
Cite this as: Paul F. Marrero Romero, "NegativeDigitalRoot" from the Notebook Archive (2024), https://notebookarchive.org/2024-12-2d71k56
Download