• 沒有找到結果。

Euler is a well-known matematician, and, among many other things, he discovered that the formula n

N/A
N/A
Protected

Academic year: 2021

Share "Euler is a well-known matematician, and, among many other things, he discovered that the formula n"

Copied!
1
0
0

加載中.... (立即查看全文)

全文

(1)

Euler is a well-known matematician, and, among many other things, he discovered that the formula n

2

+ n + 41 produces a prime for 0 ≤ n < 40. For n = 40, the formula produces 1681, which is 41 ∗ 41.

Even though this formula doesn’t always produce a prime, it still produces a lot of primes. It’s known that for n ≤ 10000000, there are 47,5% of primes produced by the formula!

So, you’ll write a program that will output how many primes does the formula output for a certain interval.

Input

Each line of input will be given two positive integer a and b such that 0 ≤ a ≤ b ≤ 10000. You must read until the end of the file.

Output

For each pair a, b read, you must output the percentage of prime numbers produced by the formula in this interval (a ≤ n ≤ b) rounded to two decimal digits.

Sample Input

0 39 0 40 39 40

Sample Output

100.00

97.56

50.00

參考文獻

相關文件

Chang-Yu 2005 proves that the Euler-Carlitz relations and the Frobenius relations generate all the algebraic relations among special Carlitz zeta values over the field ¯ k.. Jing

Other advantages of our ProjPSO algorithm over current methods are (1) our experience is that the time required to generate the optimal design is gen- erally a lot faster than many

It is well known that second-order cone programming can be regarded as a special case of positive semidefinite programming by using the arrow matrix.. This paper further studies

We compare the results of analytical and numerical studies of lattice 2D quantum gravity, where the internal quantum metric is described by random (dynamical)

• A way of ensuring that charge confinement does occurs is if there is a global symmetry which under which quarks (heavy charges) are charged and the gluons and other light fields

It is well known that the Fréchet derivative of a Fréchet differentiable function, the Clarke generalized Jacobian of a locally Lipschitz continuous function, the

It is well-known that, to deal with symmetric cone optimization problems, such as second-order cone optimization problems and positive semi-definite optimization prob- lems, this

“Since our classification problem is essentially a multi-label task, during the prediction procedure, we assume that the number of labels for the unlabeled nodes is already known