BlueBook
A natural number (greater than one), is a prime number if it has no natural number divisors other than and . Given an integer , write a program that finds the first primes, printing them ten to a line. Each number should be separated by a space.
Sample Input
5
Sample Output
2 3 5 7 11
Comments
man how do i do this
do i use a jittelang or a fukalatogan
jittleyang
This was a very cool problem!
Hi. what is the max value of . I passed 2 out of 3 sets. I'm using sieve to solve this. My code.
Your sieve sieves up to 1e6, but it only inserts primes up to the square root of that. You could either change the sieve size or just put another for loop after it to insert primes, instead of doing it both at once.
thank you so much! I added a for loop to add more primes and it passed :D thanks, aegirwang !