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
Paolo P. Lava, Table of n, a(n) for n = 1..1000
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