In number theory, the **parity problem** refers to a limitation in sieve theory that prevents sieves from giving good estimates in many kinds of prime-counting problems. The problem was identified and named by Atle Selberg in 1949. Beginning around 1996, John Friedlander and Henryk Iwaniec developed some parity-sensitive sieves that make the parity problem less of an obstacle.

Terence Tao gave this "rough" statement of the problem:^{[1]}

Parity problem. IfAis a set whose elements are all products of an odd number of primes (or are all products of an even number of primes), then (without injecting additional ingredients), sieve theory is unable to provide non-trivial lower bounds on the size ofA. Also, any upper bounds must be off from the truth by a factor of 2 or more.

This problem is significant because it may explain why it is difficult for sieves to "detect primes," in other words to give a non-trivial lower bound for the number of primes with some property. For example, in a sense Chen's theorem is very close to a solution of the twin prime conjecture, since it says that there are infinitely many primes *p* such that *p* + 2 is either prime or the product of two primes. The parity problem suggests that, because the case of interest has an odd number of prime factors (namely 1), it won't be possible to separate out the two cases using sieves.

This example is due to Selberg and is given as an exercise with hints by Cojocaru & Murty.^{[2]}^{: 133–134 }

The problem is to estimate separately the number of numbers ≤ *x* with no prime divisors ≤ *x*^{1/2}, that have an even (or an odd) number of prime factors. It can be shown that, no matter what the choice of weights in a Brun- or Selberg-type sieve, the upper bound obtained will be at least (2 + *o*(1)) *x* / ln *x* for both problems. But in fact the set with an even number of factors is empty and so has size 0. The set with an odd number of factors is just the primes between *x*^{1/2} and x, so by the prime number theorem its size is (1 + *o*(1)) *x* / ln *x*. Thus these sieve methods are unable to give a useful upper bound for the first set, and overestimate the upper bound on the second set by a factor of 2.

Beginning around 1996 John Friedlander and Henryk Iwaniec developed some new sieve techniques to "break" the parity problem.^{[3]}^{[4]}
One of the triumphs of these new methods is the Friedlander–Iwaniec theorem, which states that there are infinitely many primes of the form *a*^{2} + *b*^{4}.

Glyn Harman relates the parity problem to the distinction between *Type I* and *Type II* information in a sieve.^{[5]}

In 2007 Anatolii Alexeevitch Karatsuba discovered an imbalance between the numbers in an arithmetic progression with given parities of the number of prime factors. His papers^{[6]}^{[7]} were published after his death.

Let be a set of natural numbers (positive integers) that is, the numbers . The set of primes, that is, such integers , , that have just two distinct divisors (namely, and ), is denoted by , . Every natural number , , can be represented as a product of primes (not necessarily distinct), that is where , and such representation is unique up to the order of factors.

If we form two sets, the first consisting of positive integers having even number of prime factors, the second consisting of positive integers having an odd number of prime factors, in their canonical representation, then the two sets are approximately the same size.

If, however, we limit our two sets to those positive integers whose canonical representation contains no primes in arithmetic progression, for example , or the progression , , , , then of these positive integers, those with an even number of prime factors will tend to be fewer than those with odd number of prime factors. Karatsuba discovered this property. He found also a formula for this phenomenon, a formula for the difference in cardinalities of sets of natural numbers with odd and even amount of prime factors, when these factors are complied with certain restrictions. In all cases, since the sets involved are infinite, by "larger" and "smaller" we mean the limit of the ratio of the sets as an upper bound on the primes goes to infinity. In the case of primes containing an arithmetic progression, Karatsuba proved that this limit is infinite.

We restate the Karatsuba phenomenon using mathematical terminology.

Let and be subsets of , such that
, if contains an even number of prime factors, and , if contains an odd number of prime factors. Intuitively, the sizes of the two sets and are approximately the same. More precisely, for all , we define and , where is the cardinality of the set of all numbers from such that , and is the cardinality of the set of all numbers from such that . The asymptotic behavior of and was derived by E. Landau:^{[8]}

This shows that

that is and are asymptotically equal.

Further,

so that the difference between the cardinalities of the two sets is small.

On the other hand, if we let be a natural number, and be a sequence of natural numbers, , such that ; ; every are different modulo ; Let be a set of primes belonging to the progressions ; . ( is the set of all primes not dividing ).

We denote as a set of natural numbers, which do not contain prime factors from , and as a subset of numbers from with even number of prime factors, as a subset of numbers from with odd number of prime factors. We define the functions

Karatsuba proved that for , the asymptotic formula

is valid, where is a positive constant.

He also showed that it is possible to prove the analogous theorems for other sets of natural numbers, for example, for numbers which are representable in the form of the sum of two squares, and that sets of natural numbers, all factors of which do belong to , will display analogous asymptotic behavior.

The Karatsuba theorem was generalized for the case when is a certain unlimited set of primes.

The Karatsuba phenomenon is illustrated by the following example. We consider the natural numbers whose canonical representation does not include primes belonging to the progression , . Then this phenomenon is expressed by the formula: