Lemoine's Conjecture
Time limit2sMemory limit512 MB
Count, for each odd N up to 10^6, the representations N = p + s where p is an odd prime and s is an even semiprime (product of two primes).
- Level
Medium6 of 10
- Topics
- Number theory, Prefix sum, Math, Brute force
- Solved
- No attempts yet
Problem
- Goldbach's conjecture: every even number greater than 2 can be written as the sum of two primes.
- Weak Goldbach's conjecture: every odd number greater than 5 can be written as the sum of three primes.
- Lemoine's conjecture: every odd number greater than 5 can be written as the sum of one odd prime and one even semiprime. A semiprime is the product of two primes.
Given an odd number , find the number of ways to write it as the sum of one odd prime and one even semiprime.
Input
The first line gives the number of test cases (). Each test case consists of one line, and the integer is odd and satisfies .
Output
For each test case, output the number of ways to write as the sum of one odd prime and one even semiprime.