OFFSET
1,1
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..150
EXAMPLE
4 between 3,5; 12 between 11,13; 60 between 59,61; etc.
MATHEMATICA
d[ 1 ]=2; d[ n_ ] := d[ n ]=Module[ {}, b=Product[ d[ i ], {i, 1, n-1} ]; i=2; While[ Not[ PrimeQ[ i b-1 ]&&PrimeQ[ i b+1 ] ], i++ ]; i ]; Table[ d[ i ], {i, 1, 30} ]
(* Second Program: *)
Nest[Append[#, Block[{k = 2}, While[! AllTrue[Times @@ #*k + {-1, 1}, PrimeQ], k++]; k]] &, {2}, 62] (* Michael De Vlieger, May 15 2018 *)
PROG
(J) ms =: [: */ ,
pp =: [: *./ 1: p: <: , >:
ty =: [: pp ms
a1 =: ($: >:)`, @.ty
2 (a1~^: 30) 2x NB. Stephen Makdisi, May 06 2018
(PARI) lista(nn) = {print1(a = 2, ", "); for (n=2, nn, k = 2; while (!(isprime(k*a-1) && isprime(k*a+1)), k++); print1(k, ", "); a *= k; ); } \\ Michel Marcus, May 06 2018
CROSSREFS
KEYWORD
nonn,nice
AUTHOR
EXTENSIONS
More terms from Erich Friedman
Name edited by and more terms from Michel Marcus, May 06 2018
STATUS
approved