Skip to main content

Lemoine’s Conjecture

Any odd integer greater than 5 can be expressed as a sum of an odd prime (all primes other than 2 are odd) and an even semiprime. A semiprime number is a product of two prime numbers. This is called Lemoine’s conjecture.


function lemoine(n)
{
  var pr = [];
  var isPrime = seive(n);
  for(var q = 1; q <= n / 2; q++)
  {
    var p = n - 2 * q;
    if (isPrime[p] === 1 && isPrime[q] === 1)
    pr.push([p, q]);
  }
  return pr;
}