OFFSET
1,1
COMMENTS
(i - j) = 2 for all the calculated terms, with the exception of a(1) where (i - j) = 1 and a(6) where (i - j) = 4.
EXAMPLE
a(3) = 29 is the smallest prime (and 10th prime) such that there is a smaller 8th prime: 19 and (29 - 19) / (10 - 8) = 5 is the third prime.
MATHEMATICA
a[1]=5; a[n_] := Catch[Block[{r = Prime@n, i=2, j, p}, While[True, p = Prime[++i]; j = Mod[i, 2]; While[(j += 2) < i, If[p - Prime@j == r*(i-j), Throw@p]]]]] (* Giovanni Resta, Dec 28 2013 *)
PROG
(PARI) n=16; c=25000; for(b=2, c, forstep(a=b+2, c, 2, d=prime(a)-prime(b); e=(a-b); if(d/e==d\e&d/e==prime(n), print([a, b, prime(a), prime(b), d, e, d/e])))) \\ finds a(16) and in general a(n).
(PARI) okp(n, p) = {i = primepi(p); forprime (q = 2, p-1, j = primepi(q); if ((p-q)/(i-j) == prime(n), return(1)); ); }
a(n) = {p = 2; while (! okp(n, p), p = nextprime(p+1)); p; } \\ Michel Marcus, Dec 28 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
Robin Garcia, Dec 27 2013
EXTENSIONS
a(17)-a(25) from Giovanni Resta, Dec 28 2013
a(26)-a(33) from Donovan Johnson, Jan 01 2014
STATUS
approved