A057767 Number of twin prime pairs between P(n)^2 and P(n+1)^2 where P(n) is the n-th prime.
1, 2, 2, 4, 2, 7, 2, 4, 8, 2, 11, 7, 3, 11, 13, 13, 5, 19, 11, 3, 15, 14, 14, 21, 15, 7, 10, 6, 11, 42, 12, 27, 6, 45, 10, 20, 17, 21, 23, 25, 13, 49, 7, 20, 8, 52, 59, 23, 9, 16, 32, 9, 46, 33, 27, 43, 7, 30, 20, 12, 68, 88, 22, 18, 24, 88, 41, 70, 14
Offset: 1
Keywords
Examples
From _M. F. Hasler_, Jun 26 2019: (Start) Between P(1)^2 = 2^2 = 4 and P(2)^2 = 3^2 = 9 there is only the twin prime pair (5,7), whence a(1) = 1. Between P(2)^2 = 3^2 = 9 and P(3)^2 = 5^2 = 25 there are the twin prime pairs (11,13) and (17,19) whence a(2) = 2. Between P(3)^2 = 5^2 = 25 and P(4)^2 = 7^2 = 49 there are the twin prime pairs (29,31) and (41,43) whence a(3) = 2. Between P(4)^2 = 7^2 = 49 and P(5)^2 = 11^2 = 121 there are the twin prime pairs (59,61), (71,73), (101,103) and (107,109), whence a(4) = 4. etc. (End)
Links
- M. F. Hasler, Table of n, a(n) for n = 1..10000
- A. Dinculescu, On the Numbers that Determine the Distribution of Twin Primes, Surveys in Mathematics and its Applications, 13 (2018), 171-181.
Programs
-
Mathematica
cp[{x_,y_}]:=Count[Partition[Range[x+1,y-1],3,1],?(AllTrue[{#[[1]],#[[3]]},PrimeQ]&)]; cp/@ Partition[Prime[Range[100]]^2,2,1] (* _Harvey P. Dale, Jul 27 2024 *)
-
PARI
A057767(n,c=0)={forprime(q=2+p=nextprime(prime(n)^2),prime(n+1)^2,p+2==(p=q)&&c++); c} \\ (Replaces slower code from Jun 26 2019.) - M. F. Hasler, Jul 04 2019
Extensions
Offset corrected to 1 by M. F. Hasler, Jun 26 2019
Comments