Answer to Question #314891 in Functional Programming for Akash srivastava

Question #314891

sprime

Time Limit: 2 sec

Memory Limit: 128000 kB

Problem Statement

Sara has developed a new algorithm to find sprime for a given range starting with 2


She will start from the end mark it sprime, and mark all its factors (excluding itself) as not sprime. Then she will find the next greatest unmarked number, mark it as sprime, and mark all its factors (excluding itself) as not sprime


Your task is to calculate the the number of sprimes that are actually prime

Input

The first line contains T the number of test cases.

Each of the next T lines contain an integer n.


Constraint:-

1 <= T <= 100

2 <= n <= 10000000

Output

Output T lines, one for each test case, containing the required answer.



0
Service report
It's been a while since this question is posted here. Still, the answer hasn't been got. Consider converting this question to a fully qualified assignment, and we will try to assist. Please click the link below to proceed: Submit order

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS