For this Question: Let's define P[i] as the ith Prime Number. Therefore, P[1]=2, P[2]=3, P[3]=5, so on.
Given two integers L, R (L<=R), find the value of P[L]+P[L+1]+P[L+2]...+P[R].The first line of the input contains an integer T denoting the number of test cases.
The next T lines contain two integers L and R.

Constraints
1 <= T <= 50000
1 <= L <= R <= 50000For each test case, print one line corresponding to the required valueSample Input
4
1 3
2 4
5 5
1 5

Sample Output
10
15
11
28, I have written this Solution Code: def SieveOfEratosthenes(n):
    prime = [True for i in range(n+1)]
    pri = []
    p = 2
    while (p * p <= n):
 
        if (prime[p] == True):
 
            for i in range(p * p, n+1, p):
                prime[i] = False
        p += 1
 
    for p in range(2, n+1):
        if prime[p]:
            pri.append(p)
    return pri

N = int(input())
X = []

prim = SieveOfEratosthenes(1000000)

for i in range(1,len(prim)):
    prim[i] = prim[i]+prim[i-1]
    

for i in range(N):
	nnn = input()
	X.append((int(nnn.split()[0]),int(nnn.split()[1])))

for xx,yy in X:
    if xx==1:
        print(prim[yy-1])
    else:
        print(prim[yy-1]-prim[xx-2])






        

, In this Programming Language: Python, Now tell me if this Code is compilable or not?