OFFSET
2,1
COMMENTS
It is conjectured that this sequence is defined for all odd prime numbers.
LINKS
Lei Zhou, Table of n, a(n) for n = 2..10001
Eric Weisstein's World of Mathematics, Prime Arithmetic Progression.
FORMULA
prime(n) + a(n)*k, with n >= 2, for k = 0, 1, 2, ..., kmax(n), with kmax(n) >= 2, are primes, but prime(n) - a(n) is not a prime. prime(n)= A000040(n). - Wolfdieter Lang, Apr 17 2014
EXAMPLE
n=2: the second prime number is 3; 3, 5, 7 form a 3-term prime arithmetic progression with difference 2. So a(2) = 2.
n=3: the third prime is 5; 5, 11, 17, 23, 29 form a 5-term prime arithmetic progression with difference 6, and this is the smallest difference to obtain three or more terms, hence a(3) = 6.
n=5: the fifth prime number is 11. Although 11, 17, 23, 29 form a 4-term prime arithmetic progression with difference 6, this prime arithmetic progression actually starts with 5 (see n=3). 11, 29, 47 form a 3-term prime arithmetic progression with difference 18. So a(5) = 18.
MATHEMATICA
Table[p = Prime[n]; pt = p; While[pt = NextPrime[pt]; diff = pt - p; ! ((PrimeQ[pt + diff]) && ((! (PrimeQ[p - diff])) || (p < diff)))]; diff, {n, 2, 69}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Lei Zhou, Mar 31 2014
EXTENSIONS
Name and examples edited, link added. - Wolfdieter Lang, Apr 17 2014
STATUS
approved