Prime-Factor Prime
Time limit2sMemory limit512 MB
Count integers in [l, r] whose number of prime factors counted with multiplicity, written Omega(n), is itself prime.
- Level
Medium6 of 10
- Topics
- Number theory, Math, Array, Brute force
- Solved
- No attempts yet
Problem
A positive integer is a prime-factor prime when the number of its prime factors, counted with multiplicity, is itself prime. For example, 12 is a prime-factor prime: has 3 prime factors and 3 is prime. 210 is not a prime-factor prime, because has 4 prime factors and 4 is composite.
You are given an integer interval . Write a program that counts the prime-factor primes in that interval, that is, the prime-factor primes with .
Input
The input consists of a single test case in the following format.
l r
One line contains two integers and (, ) describing the integer interval .
Output
Print the number of prime-factor primes in .
Hint
In the first example the prime-factor primes in are 4, 6, 8 and 9, so the answer is 4.