100% Guaranteed Results


Project
$ 24.99
Category:

Description

5/5 – (1 vote)

This problem is a programming version of Problem 50 from projecteuler.net
The prime 41, can be written as the sum of six consecutive primes:
41=2+3+5+7+11+13
This is the longest sum of consecutive primes that adds to a prime below one-hundred.
The longest sum of consecutive primes below one-thousand that adds to a prime, contains 21 terms, and is equal to 953.
Which prime, ≤N, can be written as the sum of the most consecutive primes?
Note: You have to print prime as well as the length of consecutive chain whose sum is prime. If such primes are more than 1, print the least.
Input Format
The first line contains an integer T , i.e., number of test cases.
Next T lines will contain an integer N.
Output Format
Print the values corresponding to each test case in a new line.
Constraints
1≤T≤10 2≤N≤1012
Sample Input

Sample Output

Reviews

There are no reviews yet.

Be the first to review “Project”

Your email address will not be published. Required fields are marked *

Related products