Primitive Root Function w/ Euler's Totient

My own developed code to find the primitive roots of a number

Download
Download

You are now following this Submission

Cite As

Tony (2026). Primitive Root Function w/ Euler's Totient (https://au.mathworks.com/matlabcentral/fileexchange/52691-primitive-root-function-w-euler-s-totient), MATLAB Central File Exchange. Retrieved .

Acknowledgements

Inspired: Primitive root of 13

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.3.0

Improved the speed significantly (4 times faster). Now running the modulated multiplication in one go rather than resetting each time and checking each step of the way.

Download
1.2.0

Using Number theory, I have doubled the speed of this program, should run twice as fast for large primes such as 9001. Email me if interested in the research.

Download
1.1.0

Updated how we calculate our very large exponents by finding a way to modulate each multiplication. With no more round off error, this program should run correctly.

Download
1.0.0

Edited green text at the beginning of PR function for readability

Download