We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
  • HackerRank Home

    HackerRank

  • |
  • Prepare
  • Certify
  • Compete
  • Hiring developers?
  1. All Contests
  2. ProjectEuler+
  3. Project Euler #10: Summation of primes

Project Euler #10: Summation of primes

Problem
Submissions
Leaderboard
Discussions

This problem is a programming version of Problem 10 from projecteuler.net

The sum of the primes below is .

Find the sum of all the primes not greater than given .

Input Format

The first line contains an integer i.e. number of the test cases.
The next lines will contains an integer .

Constraints

Output Format

Print the value corresponding to each test case in separate line.

Sample Input 0

2
5
10

Sample Output 0

10
17

Explanation 0

  • For , we have primes as and the sum is .
  • For , we have primes as and the sum is .

Author

shashank21j

Difficulty

Medium

Max Score

100

Submitted By

19508

Need Help?


View discussions
View top submissions

rate this challenge

MORE DETAILS

Download problem statement
Download sample test cases
Suggest Edits

Choose a translation


  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy