Prime string
Statement
Goal
Consider the string composed of all prime numbers concatenated with each other.ie:
"2" + "3" + "5" + "7" + "11" + "13" ... = "23571113171923..."
find the nth character in this string
Note: Indexing starts at 0
Input
Line 1: integer n
Output
Line 1: one digit
Constraints
0 <= n <= 30000
Example
Input
0
Output
2
Game modes
Fastest, Shortest
Test cases
Test 1 Test
Input
0
Output
2
Validator 1 Validator
Input
1
Output
3
Test 2 Test
Input
100
Output
1
Validator 2 Validator
Input
200
Output
8
Test 3 Test
Input
25487
Output
2
Validator 3 Validator
Input
10000
Output
0
Test 4 Test
Input
123
Output
3
Validator 4 Validator
Input
321
Output
3
Test 5 Test
Input
14000
Output
8
Validator 5 Validator
Input
14050
Output
8
Test 6 Test
Input
15875
Output
2
Validator 6 Validator
Input
20189
Output
4
Solution language
Solution
Stub generator input