ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 24 May 2017 My Price 8.00

Some prime numbers

Some prime numbers can be expressed as Sum of other consecutive prime numbers. 
For example 

5 = 2 + 3 
17 = 2 + 3 + 5 + 7 
41 = 2 + 3 + 5 + 7 + 11 + 13 

Your task is to find out how many prime numbers which satisfy this property are present in the range 3 to N subject to a constraint that summation should always start with number 2. 

Write code to find out number of prime numbers that satisfy the above mentioned property in a given range. 

Input Format: 

First line contains a number N 

Output Format: 

Print the total number of all such prime numbers which are less than or equal to N. 

Constraints:

1. 2<N<=12,000,000,000

 

Sample Input and Output

1 20 2
(Below 20, there are 2 such numbers: 5 and 17).
5=2+3
17=2+3+5+7
2 15 1

 

 

Answers

(11)
Status NEW Posted 24 May 2017 07:05 AM My Price 8.00

-----------

Not Rated(0)