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.

A001632 Smallest prime p such that there is a gap of 2n between p and previous prime.

This page as a plain text file.
%I A001632 M3812 N1560 #38 Dec 19 2021 10:02:50
%S A001632 5,11,29,97,149,211,127,1847,541,907,1151,1693,2503,2999,4327,5623,
%T A001632 1361,9587,30631,19373,16183,15727,81509,28277,31957,19661,35671,
%U A001632 82129,44351,43391,34123,89753,162209,134581,173429,31469,404671,212777
%N A001632 Smallest prime p such that there is a gap of 2n between p and previous prime.
%C A001632 Smallest prime preceded by 2n-1 successive composites. - _Lekraj Beedassy_, Apr 23 2010
%D A001632 J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 97, p. 34, Ellipses, Paris 2008.
%D A001632 N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
%D A001632 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H A001632 T. D. Noe, <a href="/A001632/b001632.txt">Table of n, a(n) for n = 1..595</a> (from Nicely)
%H A001632 L. J. Lander and T. R. Parkin, <a href="http://dx.doi.org/10.1090/S0025-5718-1967-0230677-4">On the first appearance of prime differences</a>, Math. Comp., 21 (1967), 483-488.
%H A001632 Thomas R. Nicely, <a href="https://faculty.lynchburg.edu/~nicely/gaps/gaplist.html">First occurrence prime gaps</a> [For local copy see A000101]
%H A001632 <a href="/index/Pri#gaps">Index entries for primes, gaps between</a>
%F A001632 a(n) = 2n + A000230(n) = nextprime(A000230(n)).
%F A001632 a(n) = A000040(A038664(n)+1). - _M. F. Hasler_, Jan 26 2015
%e A001632 The first time a gap of 4 occurs between primes is between 7 and 11, so A000230(2)=7 and A001632(2)=11.
%t A001632 With[{pr=Partition[Prime[Range[35000]],2,1]},Transpose[ Flatten[ Table[ Select[pr,#[[2]]-#[[1]]==2n&,1],{n,40}],1]][[2]]] (* _Harvey P. Dale_, Apr 20 2012 *)
%o A001632 (PARI) LIMIT=10^9; a=[]; i=2; o=2; g=0; forprime(p=3,LIMIT, bittest(g,-o+o=p) && next; a=concat(a,[[p,p-precprime(p-1)]]); g+=1<<a[#a][2]; a=vecsort(a,2); while(#a>=i && a[i][2]<2*i, print1(a[i][1]",");i++)) \\ a[1] = [3, 1] is not printed, cf. A000230(0). Limit 10^7 yields a(1),...,a(70) in 0.3 sec @ 2.5 GHz. \\ _M. F. Hasler_, Jan 13 2011, updated Jan 26 2015.
%Y A001632 Cf. A000230, A002386.
%K A001632 nonn,nice,easy
%O A001632 1,1
%A A001632 _N. J. A. Sloane_
%E A001632 More terms from Larry Reeves (larryr(AT)acm.org), Nov 28 2000 and from _Labos Elemer_, Nov 29 2000
%E A001632 Terms a(1)-a(146) checked with the PARI program by _M. F. Hasler_, Jan 13 2011, Jan 26 2015