Maths & numbers

Hensel lifting calculator for polynomial roots modulo prime powers

Hensel lifting follows a chosen polynomial root from a prime modulus into higher powers of that prime.

Your numbers

Degree 1–8; integer coefficients within ±1,000,000. Keep zero placeholders.
Prime from 2 through 97.
Integer 1–8; final modulus is p^k.
One root residue in 0…p−1; only its descendants are lifted.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Hensel lifting follows a chosen polynomial root from a prime modulus into higher powers of that prime. Instead of assuming the root is simple, this calculator checks every possible next base-p digit. A simple root usually continues uniquely; a singular root can split into several descendants or have none. The complete table records each exponent, modulus and surviving residue set from the supplied starting root.

THE FORMULACandidates above r modulo p^j are r+t p^j, t=0,…,p−1. Keep exactly those with f(r+t p^j)≡0 mod p^(j+1).

A worked example

For f(x)=x²−2, prime 7 and starting root 3, the seven candidates modulo 49 are 3,10,17,24,31,38 and 45. Only 10 works, since 10²−2=98=2×49. The other root 4 modulo 7 has a different descendant, 39 modulo 49, but it is not part of this selected-root calculation. Choose seed 4 to inspect that branch.

Good to know

Polynomial degree 1–8, prime 2–97, exponent 1–8 and integer coefficients within ±1,000,000. The chosen seed must already be a root modulo p. Each level supports at most 2,000 roots, with 200,000 total tested candidates. Exceeding a cap rejects the request; no partial root list is presented as complete. Only descendants of the specified seed are returned.

One base-p digit accounts for every possible lift

Every residue reducing to r modulo p^j has the unique form r+t p^j modulo p^(j+1), where t is a digit from zero through p−1. Testing those p digits therefore gives a complete next level for that parent. Applying the construction to every surviving parent builds a complete descendant set for the chosen initial root, without searching all residues of the much larger final modulus.

Polynomial evaluation uses Horner’s rule with modular reduction at each coefficient. This keeps intermediate arithmetic exact and small relative to the current modulus. The table sorts the surviving residues numerically. A row saying None is a mathematical failure of that branch to lift, whereas a resource-limit error means the requested complete enumeration was not finished. Those outcomes must not be read as the same claim.

Only one of seven candidate digits lifts the root three modulo seven3 modulo 7310172431384510² − 2 = 2 × 49
For x²−2, seed 3 modulo 7 has candidates 3+7t modulo 49. Only t=1 gives 10, with 10²−2=98 divisible by 49. This diagram follows one seed, not all roots modulo seven.

The Modular square root calculator for a prime modulus finds the initial prime-field square roots. Hensel lifting here follows one supplied polynomial root through higher prime powers.

A zero derivative can create branching or extinction

The familiar simple-root version of Hensel’s lemma assumes f prime(r) is nonzero modulo p. Under that condition the next digit is unique. Dividing by the derivative without checking it would fail on singular roots and could incorrectly discard valid descendants. Exhaustively checking the p digit choices supports these small singular cases without making that division.

For x² modulo 2, seed zero has descendants 0 and 2 modulo 4. Both square to zero modulo 4. In contrast, x²−2 has seed zero modulo 2 but no root modulo 4, because the squares modulo 4 are only zero and one. Both examples have a derivative divisible by 2 at the seed. The derivative condition alone does not say which behavior occurs.

Keep coefficient order and branch scope visible

Enter x³−x as 1,0,−1,0. Omitting a zero changes the degree or polynomial rather than abbreviating it. A leading zero is rejected so that the displayed degree cannot disagree with the actual input. A nonprime base is rejected because the page is explicitly about successive powers of one prime.

This page is not a complete root finder over an arbitrary composite modulus. To assemble all roots modulo p^k, first identify every root modulo p and lift each seed. A general composite modulus then additionally needs Chinese remaindering across its prime-power factors. The level table solves only its declared branch problem and does not claim those surrounding operations were performed.

A few questions, answered

Why are there no final roots?

The starting root can be singular and fail to extend to a higher prime power. A completed empty branch is different from a computation rejected by the enumeration cap.

Does a starting root of 3 include the branch from 4?

No. Every returned root reduces to the selected seed modulo p. Repeat with another starting root to inspect its descendants.

Find your calculator

Start typing to explore the library.