Math sure likes their prime numbers, those with only two factors, 1 and itself. 2,3,5,7 are the first four prime numbers, written in a sequence (numbers following each other). We've made up a new sequence of numbers, primal numbers that are based on the values of the prime numbers sequence.
The 1st primal number is the value that is in the position #(value of the 1st prime) in the prime sequence. That is, the 1st prime is 2, and the prime number in 2nd position is 3, so the 1st primal number is 3.
The 2nd primal number is in position #(value of 2nd prime) in the prime sequence. 2nd prime is 3, and the 3rd prime is 5; so the 2nd primal number is 5. The sequence continues in the same pattern; 3, 5, 11, 17 are the first four primal numbers.
The input file DATA2.txt will contain 5 lines, integers 1 <= N <= 1000
The output file OUT2.txt will contain 5 lines, each the Nth primal number.
Note: think about performance for large values of N. 1000th prime is 7919, so you'd need 7919th prime to figure out what 1000th primal number is.
4 24 8 1 15
17 461 67 3 211