OFFSET
1,2
COMMENTS
Note that 6 divides a(n) for n>2. - T. D. Noe, Aug 29 2006
Van der Corput's theorem: There are infinitely many positive integers n, k such that n, n+nk, n+2nk are all prime. - Jonathan Vos Post, Apr 17 2007
LINKS
T. D. Noe, Table of n, a(n) for n = 1..10000
Terence Tao, Simons Lecture I: Structure and randomness in Fourier analysis and number theory, April 2007.
J. G. van der Corput, Über Summen von Primzahlen und Primzahlquadraten, Math. Ann. 116 (1939), 1-50.
EXAMPLE
a(3)=6 because prime(3)=5 and 5+6 and 5+12 are primes.
MATHEMATICA
f[n_] := Block[{p = Prime[n], k = 1}, If[n == 1, 0, While[ ! PrimeQ[p + 2k] || ! PrimeQ[p + 4k], k++ ]; 2k] ]; Table[f[n], {n, 80}] (* Ray Chandler, Aug 28 2006 *)
Join[{0}, Table[p=Prime[n]; k=2; While[ !PrimeQ[p+k] || !PrimeQ[p+2k], k=k+2]; k, {n, 2, 100}]] - T. D. Noe, Aug 29 2006
PROG
(PARI) a(n)=if(n<2, 0, my(p=prime(n), k); while(!isprime(p+k++)||!isprime(p+2*k), ); k) \\ Charles R Greathouse IV, Apr 24 2015
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Giovanni Teofilatto, Aug 25 2006
EXTENSIONS
Edited and extended by Ray Chandler and T. D. Noe, Aug 28 2006
STATUS
approved