A248498 The smallest number of consecutive primes beginning with prime(n+1) added to prime(n) necessary to produce another prime.
1, 8, 2, 2, 2, 4, 2, 2, 2, 2, 2, 8, 2, 4, 6, 2, 4, 2, 2, 2, 4, 2, 2, 6, 6, 2, 6, 4, 2, 4, 4, 8, 4, 2, 2, 4, 2, 2, 10, 8, 4, 20, 4, 8, 2, 8, 2, 4, 54, 2, 6, 26, 8, 26, 6, 4, 4, 2, 8, 2, 2, 2, 4, 2, 6, 6, 10, 2, 2, 2, 4, 4, 6, 6, 2, 4, 2, 8, 2, 2, 4, 10, 2, 4, 46
Offset: 1
Examples
a(1)=1 because 2+3=5 which is prime (only 1 prime added to 2 to get a prime). a(2)=8 because 3+5+7+11+13+17+19+23+29=127 which is prime (8 consecutive primes added to 3), and all of the partial sums are composite.
Links
- Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
Programs
-
PARI
a(n) = my(p = prime(n), q = nextprime(p+1), s = p+q, nb = 1); while (! isprime(s), p=q; q=nextprime(p+1); s += q; nb++); nb; \\ Michel Marcus, Oct 07 2014
Comments