Xiao Ming is a clever boy and has a strong interest in number theory. He found that it was difficult to ask how many primes between 1 and 10n, and it was difficult to determine the size of the N value. Now the question is, tell you the value of N, let you help xiaoming calculate the number of primes less than 10n total number of bits?
Input
The input data has several groups, each set of data contains 1 integers n (1 < n < 1000000000), and the processing ends if EOF is encountered.
Output
corresponding to each set of data, the number of digits less than 10n is output in one line, and the format is shown in sample output. The output of the same set of data, with a blank space between each mantissa, with no spaces at the end of the line.
Sample Input
37
Sample Output
36
Prime theorem: The number of prime numbers that are less than positive real x is recorded as f (x), so the growth of X is f (x)/(X/log (x)) = 1;
Inference: PN is the nth prime, then PN ~ nlog (n);
The number of digits of the formula: LOG10 (x) + 1;
#include <map>#include<queue>#include<stack>#include<cmath>#include<cstdio>#include<cstring>#include<iostream>#include<algorithm>#defineINF 1000000001#definell __int64#defineLson l,m,rt<<1#defineRson m+1,r,rt<<1|1using namespacestd;Const intMAXN =50010;intN;intMain () { while(Cin >>N) {cout<< (int) (N-LOG10 (n1.0)-Log10 (log (10.0))) +1<<Endl; } return 0;}
Nefu 117 Prime theorem