Blum Integer Calculator

Number

Is 21 a Blum integer?Yes - 21 = 3 x 7, and both primes are 3 mod 4
Prime factorisation3 x 7
Factors modulo 43 is 3 mod 4 and 7 is 3 mod 4
Next Blum integer after 2133
How this was calculated
  1. A Blum integer is the product of exactly two distinct primes, both congruent to 3 modulo 4 - the form used as the modulus in the Blum Blum Shub pseudorandom generator.
  2. Factorising gives 21 = 3 x 7.
  3. Both primes are congruent to 3 mod 4, so every condition holds.
  4. So 21 is a Blum integer; the next one is 33.

A Blum integer is the product of exactly two distinct primes, both congruent to 3 mod 4. This calculator takes any number you enter and reports the next Blum integer after it. For example, 21 is a Blum integer because 21 = 3 x 7, and both 3 and 7 are 3 mod 4. So is 33, since 33 = 3 x 11 and 11 is 3 mod 4. But 15 is not a Blum integer: 15 = 3 x 5, and 5 is 1 mod 4, so it fails the rule. The first Blum integers are 21, 33 and 57, and the calculator uses that same definition to find the next one after any input you give it.

The method behind the calculator is the standard definition of a Blum integer, applied directly: factor the number, check that it has exactly two distinct prime factors, and confirm that both primes are congruent to 3 mod 4. This is the accepted basis for identifying Blum integers, and the same property is why Blum integers are the standard modulus for the Blum Blum Shub pseudorandom number generator. To make the result easy to check yourself, this page shows the formula, step-by-step workings, worked examples and sources, so you can follow how each answer is reached rather than taking it on trust.

Worked examples

21 = 3 x 7

(21)

Is 21 a Blum integer?Yes - 21 = 3 x 7, and both primes are 3 mod 4
Prime factorisation3 x 7
Factors modulo 43 is 3 mod 4 and 7 is 3 mod 4
Next Blum integer after 2133

33 = 3 x 11

(33)

Is 33 a Blum integer?Yes - 33 = 3 x 11, and both primes are 3 mod 4
Prime factorisation3 x 11
Factors modulo 43 is 3 mod 4 and 11 is 3 mod 4
Next Blum integer after 3357

15 = 3 x 5, and 5 is 1 mod 4

(15)

Is 15 a Blum integer?No - the prime factor 5 is 1 mod 4, not 3 mod 4
Prime factorisation3 x 5
Factors modulo 43 is 3 mod 4 and 5 is 1 mod 4
Next Blum integer after 1521

What is a Blum integer?

A Blum integer is the product of exactly two distinct primes, both congruent to 3 mod 4. Both halves of that definition do real work. The word "exactly" rules out numbers with more than two prime factors, and "distinct" rules out squares of a single prime. The mod-4 requirement is a separate test that each of the two primes must pass on its own: when the prime is divided by 4, the remainder must be 3. A number that meets one condition but not the other is not a Blum integer, no matter how it looks at first glance.

The first condition makes a Blum integer a semiprime, meaning it has exactly two prime factors. Consider 21. It factors as 3 x 7, and both 3 and 7 are 3 mod 4, so 21 is a Blum integer. The same holds for 33: 33 = 3 x 11, and 11 is 3 mod 4. Now compare 15. It factors as 3 x 5, but 5 is 1 mod 4, so 15 fails the second condition and is not a Blum integer. The two-part test is strict, and the examples show how easily a semiprime can miss it.

The mod-4 condition is not decoration. It controls how the number -1 behaves as a quadratic residue. For a prime p congruent to 3 mod 4, -1 is not a quadratic residue modulo p; there is no integer x for which x squared is congruent to -1 mod p. Pushing this through to the product of two such primes, every quadratic residue modulo a Blum integer has exactly one square root that is itself a quadratic residue. That single-root property is what makes the modulus useful in cryptographic settings, and it depends directly on both primes being 3 mod 4.

Because the conditions are so specific, Blum integers are sparse. The first Blum integers are 21, 33 and 57, and the calculator reports the next one after any input. That makes it easy to check a candidate by hand or to walk up the sequence one term at a time. Blum integers are also the standard modulus for the Blum Blum Shub pseudorandom number generator, which relies on the structure described above.

To apply the definition, factor the number into exactly two distinct primes and then check the remainder of each prime when divided by 4. If both remainders are 3, the number is a Blum integer; if either prime leaves a remainder of 1, or if the factorization has a repeated prime or more than two primes, it is not.

Quick test: factor into exactly two distinct primes, then confirm each prime is 3 mod 4. 21 = 3 x 7 passes; 15 = 3 x 5 fails because 5 is 1 mod 4.

How the check works

The check is a short, fixed sequence of steps, and every step uses only the number you typed in. First the calculator factors the input into primes. Second it confirms there are exactly two prime factors and that they are distinct — no repeated prime, no third factor. Third it takes each of those two primes and checks its remainder when divided by 4. A Blum integer requires both remainders to be 3. If any step fails, the number is not a Blum integer, and the calculator stops there.

Working through 21 shows the full pass. The factorization is 21 = 3 x 7: exactly two primes, and 3 and 7 are different. Now the mod 4 check. 3 divided by 4 leaves a remainder of 3, so 3 qualifies. 7 divided by 4 leaves a remainder of 3 as well, so 7 qualifies too. Both primes are 3 mod 4, so 21 is a Blum integer.

The same pattern holds for 33. The factorization is 33 = 3 x 11, again two distinct primes. The prime 3 leaves a remainder of 3 mod 4. The prime 11 divided by 4 leaves a remainder of 3, so it qualifies as well. With both primes at 3 mod 4, 33 is a Blum integer — the second one in the sequence.

A failing case makes the rule concrete. Take 15. Its factorization is 15 = 3 x 5, which does pass the count test: exactly two distinct primes. The mod 4 step is where it breaks. The prime 3 leaves a remainder of 3, which is fine, but 5 divided by 4 leaves a remainder of 1. Since 5 is 1 mod 4, it fails the requirement, and 15 is not a Blum integer. One failing prime is enough to reject the whole number.

That is the entire test: factor, count two distinct primes, then confirm each prime is 3 mod 4. Because the definition is narrow, Blum integers are sparse at the low end — the first ones are 21, 33 and 57. After any input, the calculator reports the next Blum integer, which is handy when you want to see the sequence continue past a number that fails. The property also matters beyond the definition: Blum integers are the standard modulus for the Blum Blum Shub pseudorandom number generator.

21 = 3 x 7 passes (both 3 mod 4). 33 = 3 x 11 passes (both 3 mod 4). 15 = 3 x 5 fails, because 5 is 1 mod 4.

Blum integers

A Blum integer is the product of exactly two distinct primes, both congruent to 3 mod 4. That single rule does all the work: the number must factor into precisely two primes, those primes must be different from each other, and each one must leave a remainder of 3 when divided by 4. The first three numbers that satisfy the rule are 21, 33 and 57, and the calculator reports the next Blum integer after any input you give it.

Checking a candidate by hand is mostly a matter of factoring and then testing each prime factor against the mod 4 condition. Take 21: it factors as 3 x 7, and both 3 and 7 are 3 mod 4, so 21 qualifies. Take 33: it factors as 3 x 11, and 11 is 3 mod 4, so 33 qualifies too. Now take 15: it factors as 3 x 5, but 5 is 1 mod 4, so 15 fails even though 3 passes. The residue of every prime factor matters, not just one of them.

The table below sets out the first three Blum integers alongside the numbers that fail the test, so you can see the rule applied step by step.

Because the definition is narrow, Blum integers are not evenly spread through the integers and the gaps between them vary. Each one is a semiprime with a specific residue pattern in both factors, which is why the sequence opens with 21, 33 and 57 rather than with the smaller products you might expect. Numbers like 15 show how easily a near miss slips through: a single factor with the wrong residue is enough to disqualify the whole product.

That structure is what makes a Blum integer useful beyond the definition. Blum integers are the standard modulus for the Blum Blum Shub pseudorandom number generator, a construction built on the difficulty of factoring a product of two large primes of this exact form. When you enter a number into the calculator, it moves past the candidates that fail the two-prime or residue test and returns the next Blum integer, so you can locate the sequence without factoring by hand.

NumberFactorizationPrime factors mod 4Blum integer?
213 x 73 mod 4; 3 mod 4Yes
333 x 113 mod 4; 3 mod 4Yes
57——Yes
153 x 53 mod 4; 1 mod 4No
Every prime factor must be 3 mod 4. One factor at 1 mod 4 — as with 5 in 15 — is enough to disqualify the number.

Where Blum integers are used

Blum integers show up wherever a system needs a modulus whose two prime factors are both 3 mod 4. That single structural fact is what makes them useful in three well-known settings: the Blum Blum Shub pseudorandom number generator, the Blum-Goldwasser cryptosystem, and protocols built on quadratic residuosity.

Blum integers are the standard modulus for the Blum Blum Shub pseudorandom number generator. The generator depends on the difficulty of deciding whether a number is a quadratic residue modulo a composite, and that difficulty is cleanest when the modulus is a Blum integer. Because both factors are 3 mod 4, the arithmetic of residues and non-residues behaves in a predictable way, which the generator relies on to produce its output.

The Blum-Goldwasser cryptosystem is the second major use. It is a public-key scheme whose security rests on the same quadratic-residuosity assumption, with a Blum integer serving as the public modulus. The receiver, who knows the two 3 mod 4 primes, can invert the residue computations; anyone holding only the product cannot. Quadratic-residuosity protocols form the third area. These are interactive or cryptographic procedures in which one party proves or uses knowledge about whether a value is a square modulo a composite, and again a Blum integer gives the modulus the properties the protocol needs.

One property ties these uses together: every Blum integer is 1 mod 4. If you multiply two primes that are each 3 mod 4, the result is always 1 mod 4, so a modulus of the right shape is guaranteed to sit in that residue class. This is why the definition is stated as a product of exactly two distinct primes, both congruent to 3 mod 4.

Small examples make the pattern concrete. 21 is a Blum integer: 21 = 3 x 7, and both 3 and 7 are 3 mod 4. 33 is a Blum integer: 33 = 3 x 11, and 11 is 3 mod 4. 15 is not a Blum integer: 15 = 3 x 5, but 5 is 1 mod 4. The first Blum integers are 21, 33 and 57, and the calculator reports the next one after any input, so you can check candidates yourself before using them in any of the settings above.

Every Blum integer is 1 mod 4, because multiplying two primes that are each 3 mod 4 always gives a result of that form.

FAQs

What is a Blum integer?

A Blum integer is a number that is the product of exactly two distinct primes, and both of those primes must be congruent to 3 mod 4. For example, 21 = 3 x 7 is a Blum integer because 3 and 7 each leave a remainder of 3 when divided by 4.

Is 21 a Blum integer?

Yes. 21 = 3 x 7, and both 3 and 7 are congruent to 3 mod 4. Because the two primes are distinct and each is 3 mod 4, 21 meets the definition of a Blum integer.

Is 15 a Blum integer?

No. Although 15 = 3 x 5 is a product of two distinct primes, 5 is congruent to 1 mod 4, not 3 mod 4. Both primes must be 3 mod 4, so 15 does not qualify as a Blum integer.

Is 9 a Blum integer?

No. 9 = 3 x 3 uses the same prime twice, and a Blum integer requires two distinct primes. Even though 3 is congruent to 3 mod 4, the repeated factor means 9 is not a Blum integer.

What is a Blum integer used for?

A Blum integer serves as the modulus in the Blum Blum Shub pseudorandom generator, and it also appears in several public-key cryptosystems. These applications rely on the specific structure of a Blum integer, which is the product of two distinct primes that are each 3 mod 4.

Is every Blum integer congruent to 1 mod 4?

Yes. The product of two numbers that are each 3 mod 4 is always 1 mod 4. Since a Blum integer is exactly the product of two distinct primes that are each 3 mod 4, every Blum integer is congruent to 1 mod 4.

Sources

Related calculators

Carmichael Function Calculator
The Carmichael function lambda(n), the smallest universal exponent modulo n, from the prime factorization, compared with Euler's totient.
Primitive Root Calculator
The smallest primitive root modulo a prime p, the count of primitive roots from Euler's totient, and the factorization of p - 1 that the test runs on.
Carmichael Number Calculator
Test whether a number is a Carmichael number with Korselt's criterion - squarefree with p - 1 dividing n - 1 for every prime factor - and see its full factorization.