cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

This page as a plain text file.
%I A036014 #41 Aug 02 2023 14:36:58
%S A036014 2,2,3,5,3,9,6,43,18,41,82,63,47,64,108,41,192,150,91,15,5,20,214,218,
%T A036014 46,180,121,31,80,115,39,88,2,384,1828,1219,360,113,2,1111,559,687,26,
%U A036014 1000,368,3130,1198,1731,1752,1240,1237,131,814,2349,949,64,284,361,120,3398,47,2068,1001
%N 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.
%H A036014 Michael De Vlieger, <a href="/A036014/b036014.txt">Table of n, a(n) for n = 1..150</a>
%e A036014 4 between 3,5; 12 between 11,13; 60 between 59,61; etc.
%t A036014 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} ]
%t A036014 (* Second Program: *)
%t A036014 Nest[Append[#, Block[{k = 2}, While[! AllTrue[Times @@ #*k + {-1, 1}, PrimeQ], k++]; k]] &, {2}, 62] (* _Michael De Vlieger_, May 15 2018 *)
%o A036014 (J) ms =: [: */ ,
%o A036014 pp =: [: *./ 1: p: <: , >:
%o A036014 ty =: [: pp ms
%o A036014 a1 =: ($: >:)`,@.ty
%o A036014 2 (a1~^: 30) 2x NB. _Stephen Makdisi_, May 06 2018
%o A036014 (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
%Y A036014 Cf. A014574 (average of twin primes pairs), A359948, A363274.
%K A036014 nonn,nice
%O A036014 1,1
%A A036014 _Russell Easterly_
%E A036014 More terms from _Erich Friedman_
%E A036014 Name edited by and more terms from _Michel Marcus_, May 06 2018