OFFSET
1,1
LINKS
R. J. Mathar, Table of n, a(n) for n = 1..1000
MAPLE
A082466 := proc(n)
local k, p ;
for k from 1 do
p := (n+k)*n-1 ;
if isprime(p) and isprime(p+2) then
return k;
end if;
end do:
end proc: # R. J. Mathar, Jul 20 2012
MATHEMATICA
lk[n_]:=Module[{k=1}, While[!And@@PrimeQ[n^2+k*n+{1, -1}], k++]; k]; Array[ lk, 90] (* Harvey P. Dale, Nov 25 2013 *)
PROG
(PARI) a(n)=if(n<0, 0, k=1; while(isprime(n^2+k*n+1)*isprime(n^2+k*n-1)==0, s++); k)
CROSSREFS
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Apr 27 2003
STATUS
approved