Problem B
Semi-prime H-numbers

This problem is based on an exercise of David Hilbert, who
pedagogically suggested that one study the theory of
An H-number is a positive number
which is one more than a multiple of four:
As with regular integers, we partition the H-numbers into units, H-primes, and H-composites.
For examples, the first few H-composites are:
Your task is to count the number of H-semi-primes. An H-semi-prime is an H-number which can be written as the product of
exactly two H-primes. The two H-primes may be equal or different. Of the
examples above, all five numbers are H-semi-primes.
Input
Each line of input contains an H-number
Output
For each H-number
Sample Input 1 | Sample Output 1 |
---|---|
21 85 789 0 |
21 0 85 5 789 62 |