http://www.careercup.com/question?id=5763123118080000

 

Primes after a point in the series are multiples of 6 +/-1. that is 31 = 30 + 1, 37 = 36 + 1 and so on.
So find the first number in 10 digits that is divisible by 6 and then from then on check if no-1 or no+1 is prime. increment by 6 and do the same check until the prime count = 5

这个题目下面有个很好的思路,

任何大于3的素数都可以表示成为6q +/- 1。

证明:

对于任何数n>3

处以6之后能表示成6q+r

r:0,1,2,3,4,5

当r为0,2,4的时候,n可以被2整除,所以不是素数;

当n为3的时候,可以被3整除;

只能为1,5,第一种就是6q+1,第二种是6q+5 = 6(q+1)-1