A grand prime pair is a pair of primes, p1 and p2=p1+1000, such that both numbers are prime. Like a twin prime pair, where the difference is 2, the members of a grand prime pair always have a difference of 1000. Some facts about grand prime pairs, so that you can test your code:
1. The smallest grand prime pair is [13,1013], the 100th such pair is [3229,4229].
2. There are 37 grand prime pairs such that the larger element of the pair is no larger than 2000.
3. There should be infinitely many grand prime pairs.
4. All such grand prime pairs must have the property that the smaller element of the pair is of the form 6*k+1, for some integer k.
Write a function that counts the number of grand prime pairs that exist, such that the larger element of the pair is no larger than N. I'll be nice and not ask you to compute that result for N too large, 1e8 seems a reasonable upper limit.
267 Solvers
Getting the indices from a vector
1574 Solvers
Getting the row and column location from a matrix
192 Solvers
Matrix which contains the values of an other matrix A at the given locations.
196 Solvers
Determine the number of odd integers in a vector
330 Solvers