DCEPC203 - Obsession
Ankur sir is really obsessed with dce coders. Every other day he announces to the admins the current number of members and boasts about the continuous increase in the member count. Within a week the admins got bored of his habit and started losing interest in this topic. Ankur sir is very clever. He knows that every body loves to solve puzzles. To maintain their interest he decides to ask a puzzle based on the number of current members. This way he can still bug the admins about the increasing member count without making them feel bored. The puzzle says for the given member count N, tell me how how many smaller numbers (k ≥ 2) exist such that F(k) = 2 * k * k - 1 is a prime.
Input
First line gives T, the number of test cases
Each of the next T lines give a number N.
Output
Print the output for every test case on a new line
Constraints
T ≤ 1000
2 ≤ N ≤ 10000000
Example
Input: 1 5 Output: 3
hide comments
fakesson:
2019-12-12 22:33:43
very similar to https://projecteuler.net/problem=216 |
|
[Lakshman]:
2015-06-28 21:02:48
I Have checked all inputs till 1e7 with My brute force.
|
|
The next big thing:
2015-06-28 16:46:38
Please help me i'm getting wa...submission ID 14557381
|
|
[Lakshman]:
2013-07-17 16:43:22
Need help can any one tell me what is the maximum value of f(k) ?..is it 2*10000000*10000000-1? |
|
[Rampage] Blue.Mary:
2013-03-12 10:20:42
My solution is indeed very humble. |
|
(Tjandra Satria Gunawan)(曾毅昆):
2012-09-29 17:21:50
My Brute-force solution: AC! yeah! :-D
|
|
dce coders:
2012-03-11 12:41:51
@Mehmet: Input file is correct.
|
|
Mitch Schwartz:
2012-03-11 02:35:38
From the problem description, it seems we can assume the values of N are given in strictly increasing order in the input file. Is this true?
|
|
mehmetin:
2012-03-08 18:54:58
Is there something wrong with the input? I'm getting TLE, can you check my submission with ID 6623040? I'm getting 4902128 for n = 10,000,000. Is that correct? Last edit: 2012-03-08 18:56:29 |
Added by: | dce coders |
Date: | 2012-02-27 |
Time limit: | 2.355s |
Source limit: | 3000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
Resource: | Own Problem |