OFFSET
1,5
EXAMPLE
a(4)=1 because 4-1=3, 4+1=5, 3*4-1=11 and 3*4+1=13 are all primes,
a(5)=2 because 5-2=3, 5+2=7, 3*5-2=13 and 3*5+2=17 are all primes.
MATHEMATICA
Table[k = 0; While[k < n && ! (PrimeQ[n - k] && PrimeQ[n + k] && PrimeQ[3 n - k] && PrimeQ[3 n + k]), k++]; If[k == n, 0, k], {n, 100}] (* T. D. Noe, Apr 26 2012 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Gerasimov Sergey, Apr 26 2012
STATUS
approved