Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|

Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |

Language: Fermat's Christmas Theorem
Description In a letter dated December 25, 1640; the great mathematician Pierre de Fermat wrote to Marin Mersenne that he just proved that an odd prime
Whereas the primes 11, 19, 23, and 31 cannot be expressed as a sum of two squares. Write a program to count the number of primes that can be expressed as sum of squares within a given interval. Input Your program will be tested on one or more test cases. Each test case is specified on a separate input line that specifies two integers The last line of the input file includes a dummy test case with both Output For each test case, write the result using the following format:
where Sample Input 10 20 11 19 100 1000 -1 -1 Sample Output 10 20 4 2 11 19 4 2 100 1000 143 69 Source |

[Submit] [Go Back] [Status] [Discuss]

All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di

Any problem, Please Contact Administrator