Skip to content
OneKitly

Primitive root calculator

Find the primitive roots modulo n — the generators g whose powers g¹, g², … run through every number coprime to n before repeating (order equal to φ(n)). Primitive roots exist only when n is 1, 2, 4, pᵏ or 2pᵏ for an odd prime p; the tool reports the smallest one, the exact count φ(φ(n)) and lists them. They are the backbone of discrete-logarithm cryptography and Diffie–Hellman key exchange.

Need Primitive roots exist?, Smallest primitive root, Number of primitive roots φ(φ(n)), Primitive roots? The Primitive root calculator derives it from Modulus n in one step. For instance, with Modulus n = 7 it returns Primitive roots exist? = yes, Smallest primitive root = 3 and Number of primitive roots φ(φ(n)) = 2.

How to use it

  1. Enter your values: Modulus n.
  2. Read the result instantly: Primitive roots exist?, Smallest primitive root, Number of primitive roots φ(φ(n)), Primitive roots.

Frequently asked questions

What does the Primitive root calculator actually compute?

It takes Modulus n and derives Primitive roots exist?, Smallest primitive root, Number of primitive roots φ(φ(n)) and Primitive roots from them. The calculation is live as you type, so the result updates on every change.

What information do I need to provide?

A single value: Modulus n. Nothing else is required — no account, no file upload.

Can you show a worked example?

With Modulus n = 7, the calculator returns Primitive roots exist? = yes, Smallest primitive root = 3 and Number of primitive roots φ(φ(n)) = 2. Those figures come from running this exact tool, so you can reproduce them by entering the same values.

What does it give for smaller values?

Scaled down to Modulus n = 4, Number of primitive roots φ(φ(n)) comes out at 1. The relationship is worth checking at both ends before you rely on a single result.

When would I actually use this?

Getting through a problem set: solving for the unknown, factoring an expression, and — more usefully — seeing the steps that got there.

What is the most common mistake?

Losing a solution when both sides are squared or divided by an expression. Squaring can add roots that do not satisfy the original equation, and dividing can remove one — check every answer back in the original.

What is the difference between the Primitive root calculator and the Cube root calculator?

This one returns Primitive roots exist? and Smallest primitive root; the Cube root calculator returns Cube root and Cube (n³). That is the whole difference — open the one whose figure you need.

Is there a tool for the next step?

Nth root calculator is the closest one after this: Compute any root (square, cube, nth) of a number.

What else is worth having open alongside it?

Square root calculator and Digital Root Calculator — they come up in the same task often enough to be worth a second tab.

Where do the figures come from, and how current are they?

The algebra is symbolic where the expression allows it and numeric otherwise, and the tool says which it used. Exact results are given as fractions or radicals rather than rounded decimals.

Further reading

All guides
Primitive root calculator — OneKitly