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.

A167132 Gaps between twin prime pairs.

This page as a plain text file.
%I A167132 #15 Jul 13 2021 07:29:56
%S A167132 0,4,4,10,10,16,10,28,4,28,10,28,10,4,28,10,28,10,28,34,70,10,28,58,
%T A167132 46,28,16,22,16,148,10,4,28,22,136,10,16,10,28,58,76,46,10,10,16,106,
%U A167132 22,28,4,118,10,46,28,22,64,82,4,52,16,46,28,52,4,22,16,10,94,28,40,28,40,166
%N A167132 Gaps between twin prime pairs.
%C A167132 Let G_n denote the twins gap between two consecutive twins, thus a twins gap is the difference between two consecutive twins (p_n, p_n+2) and (p_m, p_m+2), i.e., the difference between p_m and p_n+2. G_n = p_m - (p_n +2) We have: G_1 = 0, G_2 = 4, G_3 = 4, G_4 = 10.
%H A167132 T. D. Noe, <a href="/A167132/b167132.txt">Table of n, a(n) for n = 1..10000</a>
%H A167132 <a href="http://primes.virtual-library.biz/">Program to generate the sequence</a>
%F A167132 a(n) = A001359(n+1) - A006512(n). - _R. J. Mathar_, Oct 29 2009
%p A167132 A001359 := proc(n) if n = 1 then 3; else a := nextprime(procname(n-1)) ; while not isprime(a+2) do a := nextprime(a) ; od: return a; fi; end: A006512 := proc(n) A001359(n)+2 ; end: A167132 := proc(n) A001359(n+1)-A006512(n) ; end: seq(A167132(n),n=1..120) ; # _R. J. Mathar_, Oct 29 2009
%t A167132 ps = Prime[Range[1000]]; p2 = Flatten[Position[Differences[ps], 2]]; Differences[ps[[p2]]] - 2 (* _T. D. Noe_, Jan 10 2012 *)
%K A167132 nonn
%O A167132 1,2
%A A167132 _Oleg Zyakun_, Oct 28 2009