login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A239864
Starting from any prime p_i (with i = 1, 2, 3 …) sequence lists the minimum number of consecutive primes that must be added to 1 to reach another prime.
4
1, 16, 2, 2, 4, 2, 2, 2, 2, 2, 8, 2, 8, 6, 2, 2, 12, 16, 2, 4, 6, 2, 2, 6, 2, 4, 2, 4, 2, 2, 14, 2, 2, 8, 8, 6, 4, 2, 4, 2, 12, 2, 10, 22, 2, 10, 16, 8, 2, 2, 40, 8, 4, 2, 2, 12, 2, 18, 6, 6, 2, 2, 2, 8, 2, 18, 30, 6, 4, 4, 4, 2, 20, 10, 4, 2, 2, 4, 2, 2, 20
OFFSET
1,2
COMMENTS
61 is the minimum prime that can be reached in two ways: adding 1 plus 4 consecutive primes starting from 11 or 2 starting from 29.
Other primes reachable in two ways: 331, 373, 457, 1013, 1321, 1429, 1549, 1901, 2113, 2281, etc.
991 is the minimum prime that can be reached in three ways: adding 1 plus 12 consecutive primes starting from 59, 6 starting from 151 or 2 starting from 491.
Other primes reachable in three ways: 8011, 14827, 24181, 33049, 34351, 40819, 41887, 49549, 59069, 60961, etc.
LINKS
EXAMPLE
a(1) = 1 because p_1 = 2 and 2 + 1 = 3 is prime.
a(2) = 16 because p_2 = 3 and we need to add other 15 consecutive primes plus 1 to reach another prime: 3 + 5 + 7 + 11 + 13 + 17 + 19 + 23 + 29 + 31 + 37 + 41 + 43 + 47 + 53 + 59 + 1 = 439.
a(3) = 2 because p_3 = 5 and 5 + 7 + 1 = 13 is prime. Etc.
MAPLE
P:=proc(q) local a, b, c, d, n;
for n from 1 to q do a:=1; b:=ithprime(n); c:=b; d:=b+1;
while not isprime(d) do a:=a+1; c:=nextprime(c); d:=d+c; od;
print(a); od; end: P(10^4);
MATHEMATICA
a[n_] := Module[{s = 1, k = 0, p = Prime[n]}, While[!PrimeQ[s], s += p; p = NextPrime[p]; k++]; k]; Array[a, 100] (* Amiram Eldar, Mar 31 2019 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Paolo P. Lava, Mar 28 2014
STATUS
approved