Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Get a congruent integer for a given fraction and modulus
ResourceFunction["FractionMod"][a/b,n] returns |
7×3 (mod 16) equals 5:
| In[1]:= |
| Out[1]= |
Similarly, the fractional modulus of 3/5 (mod 16) equals 7:
| In[2]:= |
| Out[2]= |
As expected, adding 16 gives the same result (mod 16):
| In[3]:= |
| Out[3]= |
A grid of fractions, moduli and fractional moduli:
| In[4]:= | ![]() |
| Out[4]= | ![]() |
A range of fractional moduli (mod 8) with tooltips:
| In[5]:= | ![]() |
| Out[5]= | ![]() |
A few of the fractions and their fractional moduli (mod 8):
| In[6]:= |
| Out[6]= |
The fractional moduli of a series of prime denominator fractions gives a shuffling of the integer range:
| In[7]:= |
| Out[7]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License