A036014 a(n) is the smallest number such that the product a(1)a(2)...a(n) falls between a twin prime pair, starting with a(1)=2.
2, 2, 3, 5, 3, 9, 6, 43, 18, 41, 82, 63, 47, 64, 108, 41, 192, 150, 91, 15, 5, 20, 214, 218, 46, 180, 121, 31, 80, 115, 39, 88, 2, 384, 1828, 1219, 360, 113, 2, 1111, 559, 687, 26, 1000, 368, 3130, 1198, 1731, 1752, 1240, 1237, 131, 814, 2349, 949, 64, 284, 361, 120, 3398, 47, 2068, 1001
Offset: 1
Examples
4 between 3,5; 12 between 11,13; 60 between 59,61; etc.
Links
- Michael De Vlieger, Table of n, a(n) for n = 1..150
Programs
-
J
ms =: [: */ , pp =: [: *./ 1: p: <: , >: ty =: [: pp ms a1 =: ($: >:)`,@.ty 2 (a1~^: 30) 2x NB. Stephen Makdisi, May 06 2018
-
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 *)
-
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
Extensions
More terms from Erich Friedman
Name edited by and more terms from Michel Marcus, May 06 2018