Proth Number Calculator

Term

Proth number N97
Form check (k odd and k < 2^n)Valid Proth form
PrimalityPrime
Digits in N2
How this was calculated
  1. A Proth number has the form N = k x 2^n + 1 with k odd and k < 2^n; Proth's theorem then gives a one-shot primality test for numbers of this shape.
  2. Here k = 3 and n = 5: 2^n = 32, so N = 3 x 32 + 1 = 97, and the form check passes.
  3. Proth's theorem settles primality: with base a = 5, a^((N - 1) / 2) mod N = 96, which is -1 modulo 97, so N is prime.
  4. So 97 is prime; Proth primes are a favourite target of distributed prime searches because the test above is so cheap.

A Proth number has the form N = k x 2^n + 1, where k is odd and k < 2^n. This Proth number calculator lets you enter k and n and returns the resulting number, along with whether it is prime or composite. For example, with k = 3 and n = 5, the Proth number is 3 x 32 + 1 = 97, which is prime. With k = 5 and n = 3, the Proth number is 41, which is prime. Not every Proth number is prime: with k = 3 and n = 4, the result 49 is composite, since 49 = 7^2. The calculator gives you the number and its status in one step, so you can check a candidate quickly instead of working through the arithmetic by hand.

The primality test behind the calculator rests on Proth's theorem, which says that if some base a has a^((N - 1) / 2) congruent to -1 modulo N, then N is prime. That theorem is the accepted standard for testing Proth numbers, which is why the calculator relies on it rather than on trial division or guesswork. This page shows the formula, the step-by-step workings, worked examples such as 97, 41 and 49, and the sources behind the method, so you can follow each result from start to finish and see exactly how the answer was reached.

Worked examples

k = 3, n = 5 gives 97

(3 · 5)

Proth number N97
Form check (k odd and k < 2^n)Valid Proth form
PrimalityPrime
Digits in N2

k = 5, n = 3 gives 41

(5 · 3)

Proth number N41
Form check (k odd and k < 2^n)Valid Proth form
PrimalityPrime
Digits in N2

k = 3, n = 4 gives 49

(3 · 4)

Proth number N49
Form check (k odd and k < 2^n)Valid Proth form
PrimalityComposite: 7^2
Digits in N2

What is a Proth number?

A Proth number is a whole number written in the form N = k x 2^n + 1, with two conditions attached to k. First, k must be odd. Second, k must be smaller than 2^n. Those two rules are what separate a true Proth number from any odd number that merely happens to look like one. The n is a positive integer, and together k and n fix the value of N. Because the 2^n part grows quickly, the condition k < 2^n means the odd multiplier stays small relative to the power of two it is paired with.

The form is easiest to see with small examples. Take k = 3 and n = 5. Here 2^n is 32, and k = 3 is odd and less than 32, so the rules are satisfied. The number is 3 x 32 + 1 = 97, which is prime. Now take k = 5 and n = 3. Here 2^n is 8, and k = 5 is odd and less than 8, so this is also a valid Proth number: 5 x 8 + 1 = 41, which is prime. Not every valid choice gives a prime, though. With k = 3 and n = 4, the result is 3 x 16 + 1 = 49, and 49 is composite because 49 = 7^2. So being a Proth number is about the shape of the number, not a guarantee that it is prime.

That distinction is the reason a proth number calculator is useful: it can check the two conditions on k, build the number from your inputs, and then test whether the result is prime. The shape of N = k x 2^n + 1 makes that primality test unusually cheap. Because N - 1 factors as k x 2^n, with k odd and small, the number one less than N has a large power of two built into it. Proth's theorem exploits exactly this: if some base a satisfies a^((N - 1) / 2) congruent to -1 modulo N, then N is prime. In other words, a single modular exponentiation can settle primality, rather than the many trial divisions a general number might require.

The two conditions on k are not decoration. Requiring k to be odd keeps the power of two from being absorbed into k, so the factor 2^n in N - 1 is as large as possible. Requiring k < 2^n keeps the odd part smaller than the power of two, which is the setting Proth's theorem is built for. Numbers that fail either condition may still be prime, but they fall outside the Proth family and the theorem's clean shortcut does not apply to them in the same way.

Proth number: N = k x 2^n + 1, where k is odd and k < 2^n. Example: k = 3, n = 5 gives 3 x 32 + 1 = 97, which is prime.

Proth's theorem, the built-in primality test

Proth's theorem gives the proth number calculator its built-in primality test. The statement is short: if you can find a base a such that a raised to the power (N - 1) / 2 is congruent to -1 modulo N, then N is prime. In other words, a single matching witness settles the question in favor of primality. The theorem applies to numbers of the form N = k x 2^n + 1 where k is odd and k < 2^n — the defining shape of a Proth number. Because N - 1 = k x 2^n, the exponent (N - 1) / 2 is easy to form, which is what makes the test practical to run.

Walk through the example N = 97. Here k = 3 and n = 5, so N = 3 x 32 + 1 = 97, and 97 is prime. The exponent is (97 - 1) / 2 = 48. Pick a witness base and raise it to the 48th power modulo 97. If the result is -1 modulo 97, Proth's theorem certifies 97 as prime without any further checking. The same structure carries over to smaller cases: with k = 5 and n = 3, the Proth number is 41, which is prime, and the test again reduces to one modular exponentiation with exponent (41 - 1) / 2 = 20.

The perfect-square case shows where the theorem runs out. With k = 3 and n = 4, the result is 49, and 49 is composite: 49 = 7^2. For a composite N, no base a can satisfy the congruence, so the search for a witness fails. That failure is not proof of anything by itself — it simply means Proth's theorem cannot decide the case. When no witness exists, trial division decides: testing small factors finds 7, and 7 x 7 = 49 confirms the number is composite.

That two-part behavior is what a good proth number calculator should make visible. First it checks the form — k odd and k < 2^n — then it looks for a witness base. A witness means prime; no witness in the perfect-square case means the tool falls back to trial division to settle the question. The table below collects the worked examples exactly as stated.

knN = k x 2^n + 1Status
3597Prime
5341Prime
3449Composite: 49 = 7^2
Proth's theorem is a one-sided test: a witness base proves N is prime, but a failed search does not prove N is composite. In the 49 = 7^2 case, trial division supplies the answer.

Worked values

The first case is 97. To use the proth number calculator approach by hand, you check whether 97 can be written as k x 2^n + 1 with k odd and k < 2^n. Taking k = 3 and n = 5 gives 3 x 32 + 1 = 97. The form check passes on both counts: k = 3 is odd, and 3 is less than 2^5 = 32. The primality verdict for 97 is prime.

The second case is 41. Here k = 5 and n = 3, so the expression is 5 x 8 + 1 = 41. The form check again passes: 5 is odd, and 5 is less than 2^3 = 8. The verdict for 41 is prime.

The third case is 49, and it shows why the form check alone does not settle primality. With k = 3 and n = 4, the expression is 3 x 16 + 1 = 49. The form check passes because 3 is odd and 3 is less than 2^4 = 16, so 49 is a Proth number. But the verdict is composite: 49 = 7^2. Being a Proth number does not guarantee being prime.

Proth's theorem explains how the primality verdict is reached for a candidate that passes the form check. It says that if some base a has a^((N - 1) / 2) congruent to -1 modulo N, then N is prime. For 97, that means testing a^48 modulo 97; for 41, testing a^20 modulo 41. A single base that produces -1 is enough to confirm primality. For 49, no base can produce the required result, consistent with 49 = 7^2.

  • 97: k = 3, n = 5; 3 x 32 + 1 = 97; k is odd and 3 < 32, so the form check passes; verdict: prime.
  • 41: k = 5, n = 3; 5 x 8 + 1 = 41; k is odd and 5 < 8, so the form check passes; verdict: prime.
  • 49: k = 3, n = 4; 3 x 16 + 1 = 49; k is odd and 3 < 16, so the form check passes; verdict: composite, since 49 = 7^2.
Passing the Proth form check (k odd and k < 2^n) does not make a number prime. Of the three worked values, 97 and 41 are prime, but 49 is composite: 49 = 7^2.

Proth primes and prime hunting

Proth primes matter to prime hunters because they come with a test that is unusually quick for numbers of their size. Proth's theorem says that if some base a has a^((N - 1) / 2) congruent to -1 modulo N, then N is prime. That single congruence check can certify primality, which is far cheaper than the general-purpose tests needed for arbitrary numbers of the same length. Since a Proth number has the form N = k x 2^n + 1 where k is odd and k < 2^n, the exponent n can be large while k stays small, so the numbers grow quickly in digits without the arithmetic becoming unwieldy. A proth number calculator is a practical way to see this structure firsthand: enter k and n, confirm the k < 2^n condition, and check small cases before scaling up.

The form also makes the numbers easy to generate in bulk. Fix an odd k and let n climb, and each step produces a new candidate with one more power of two. Small examples show both outcomes. With k = 3 and n = 5, the Proth number is 3 x 32 + 1 = 97, which is prime. With k = 5 and n = 3, the Proth number is 41, which is prime. But with k = 3 and n = 4, the result 49 is composite: 49 = 7^2. So the family is rich in primes without being uniformly prime, which is exactly what a search needs.

That combination — fast certification and a steady supply of candidates — is why distributed computing projects assign Proth prime searches to volunteers' machines. Each participant tests a slice of the candidate space, and the Proth test's speed means many candidates can be screened per unit of computing time. The payoff is size: records for the largest known primes have often come from Proth-style forms, because the special shape permits tests that would be impractical for a random number of comparable length.

The same structure underlies Sierpinski-style searches. A Sierpinski number is an odd k such that k x 2^n + 1 is composite for every n, and the hunt for such k — and for the primes that rule candidates out — runs through exactly the Proth form. When a project fixes k and sweeps n, every hit is a Proth prime and every miss is evidence toward Sierpinski behavior. The two efforts share candidates, share the test, and share the bookkeeping of which k and n pairs have been covered.

In practice, a hunt proceeds in stages: generate candidates, apply quick divisibility filters, then run the Proth congruence test on the survivors. The theorem's condition is sufficient, so a single passing base settles primality; a failing base only means that base did not certify the number, and the search moves on. Because k must stay below 2^n, each fixed k eventually stops qualifying as n grows, which shapes how projects organize their ranges and why small k values remain popular targets.

Proth's theorem: if a^((N - 1) / 2) is congruent to -1 modulo N for some base a, then N is prime.

FAQs

What is a Proth number?

A Proth number is an integer of the form k x 2^n + 1 with k odd and k < 2^n. For example, 3 x 2^5 + 1 equals 97. Both conditions matter: k must be odd, and k must be smaller than 2^n. Numbers meeting this shape can be checked with a specialized primality test.

How do you test a Proth number for primality?

Use Proth's theorem. Find a base a whose Jacobi symbol against N is -1, then check whether a^((N - 1) / 2) is congruent to -1 modulo N. If that congruence holds, N is prime. This test is what makes Proth numbers practical to check.

Is 49 a Proth prime?

No. 49 does have the Proth form, since 3 x 2^4 + 1 equals 49, but it is composite because 49 = 7^2. Having the Proth form alone never guarantees primality. You still need to run the theorem's test to confirm whether the number is actually prime.

What if k is even or bigger than 2^n?

Then the number is not in Proth form at all, and Proth's theorem does not apply. You can rewrite the number with an odd k if possible, or fall back on a general primality test. Check the two conditions, odd k and k < 2^n, before relying on the theorem.

Are Proth numbers the same as Fermat numbers?

No, but they are related. Fermat numbers are the special case k = 1, where N = 2^n + 1, and n itself must then be a power of 2. Proth numbers allow other odd values of k, as long as k < 2^n, so Fermat numbers form a narrower family within the Proth form.

Why do prime hunters care about Proth numbers?

Because Proth's theorem tests them far faster than general-purpose primality methods. That speed makes very large candidates practical to check, so record-size primes are often Proth primes. The special form gives a shortcut that general numbers do not have.

Sources

Related calculators

Mersenne Prime Calculator
Test whether a Mersenne number 2^p - 1 is prime with the Lucas-Lehmer test, for exponents up to 61.
Fermat Number Calculator
Compute the Fermat number F(n) = 2^(2^n) + 1, count its digits and test it for factors, reproducing Euler's factorization of F(5).
Prime Factorization Calculator
Break any whole number up to a trillion into its prime factors — with divisor count, divisor sum and largest prime factor.