Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Get the integers from 1 to n that have no common proper factor with n
ResourceFunction["Totatives"][n] gives the numbers in the range 1 to n that are relatively prime to n. |
The GCDs of these numbers with 10 is 1:
In[1]:= |
Out[1]= |
In[2]:= |
Out[2]= |
In[3]:= |
Out[3]= |
The length of the result of Totatives is given by EulerPhi:
In[4]:= |
Out[4]= |
The totatives of n form a multiplicative group modulo n:
In[5]:= |
Out[5]= |
Here is its multiplication table:
In[6]:= |
Out[6]= |
This plots the totative of n above (n,0), for n = 1,2,…,40:
In[7]:= |
Out[7]= |
Wolfram Language 11.3 (March 2018) or above
This work is licensed under a Creative Commons Attribution 4.0 International License