Namgyu is a curious person. He built a function F that takes two integers a and b and computes a value from the primes that lie between them.
Let the primes inside the closed interval [a,b], listed from smallest to largest, be A1<A2<⋯<An. The function F(a,b) multiplies every odd numbered prime by 3 and adds it, then subtracts every even numbered prime as it is.
F(a,b)=3A1−A2+3A3−A4+3A5−A6+…
The count n decides the sign of the last term. If n is odd the sum ends with +3An, and if n is even it ends with −An.
For example, consider F(3,7). The primes from 3 to 7 inclusive are 3, 5, and 7, so the value is 3×3−5+3×7=25.
If the interval holds no prime at all, F(a,b) is 0.