OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
isA001359 := proc(n) RETURN( isprime(n) and isprime(n+2)) ; end: A124522 := proc(n) local k; k :=1 ; while true do if isA001359(2*n*k-1) then RETURN(k) ; fi ; k := k+1 ; od ; end: for n from 1 to 60 do printf("%d, ", A124522(n)) ; od ; # R. J. Mathar, Nov 06 2006
MATHEMATICA
f[n_] := Block[{k = 1}, While[Nand @@ PrimeQ[{-1, 1} + 2n*k], k++ ]; k]; Table[f[n], {n, 91}] (* Ray Chandler, Nov 16 2006 *)
skp[n_]:=Module[{k=1}, While[AnyTrue[2n k+{1, -1}, CompositeQ], k++]; k]; Join[{2}, Array[skp, 100, 2]] (* Harvey P. Dale, Mar 30 2024 *)
PROG
(PARI) {for(n=1, 91, k=1; while(!isprime(2*n*k-1)||!isprime(2*n*k+1), k++); print1(k, ", "))}
CROSSREFS
KEYWORD
nonn
AUTHOR
Artur Jasinski, Nov 04 2006
EXTENSIONS
Edited and extended by Klaus Brockhaus and R. J. Mathar, Nov 06 2006
STATUS
approved