Submit | All submissions | Best solutions | Back to list |
PPRIME - PPrimes |
N is a prime number if it has no positive divisors other than 1 and N. Prime numbers in sorted arrangement will a prime sequence.
First 10 primes of this sequence are 2,3,5,7,11,13,17,19 and 23 [Note: 1 is not prime]
Here we can say that 2 is 1st prime [Since it is at 1st location in the sequence]
3 is 2nd prime
5 is 3rd prime and so on…A PPrime is a number which is at a prime position in the above prime sequence. Eg. 2 is a Prime but not a PPrime because it is at position 1 in the prime sequence, which is not a prime position (as 1 is not prime). However 3 is a PPrime because it is at position 2, which is a prime position (as 2 is prime).
Your task is to simply print the first 10,000 PPrimes. The twist here is that you have to do so using the shortest possible code. Shorter the code, better the score.
Input
No InputOutput
Print first 10,000 PPrimes separated by a spaceScoring
Shortest code wins ;)
Added by: | Manish Singh Bisht |
Date: | 2014-04-15 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
hide comments