OFFSET
1,1
COMMENTS
257 is the minimum prime that can be reached in two ways: adding 4 consecutive primes starting from 59 or 2 starting from 127 and deleting 1.
Other primes reachable in two ways: 389, 479, 491, 761, 863, 1319, 1847, 2131, 3037, 3299, etc.
239 is the minimum prime that can be reached in three ways: adding 8 consecutive primes starting from 17, 4 starting from 53 or 2 starting from 113 and deleting 1.
Other primes reachable in three ways: 24083, 32369, 34259, 40709, 49547, 51997, 60527, 66883, 69959, 75767, etc.
LINKS
Paolo P. Lava, Table of n, a(n) for n = 1..1000
EXAMPLE
a(1) = 17 because p_1 = 2 and we need to add other 16 consecutive primes minus 1 to reach another prime: 2 + 3 + 5 + 7 + 11 + 13 + 17 + 19 + 23 + 29 + 31 + 37 + 41 + 43 + 47 + 53 + 59 - 1 = 439.
a(2) = 1 because p_2 = 3 and 3 - 1 = 2 is prime.
a(3) = 2 because p_3 = 5 and 5 + 7 - 1 = 11 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
