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.

Showing 1-3 of 3 results.

A338812 Smaller term of a pair of sexy primes (A023201) such that the distance to next pair (A227346) is a square.

Original entry on oeis.org

7, 13, 37, 97, 103, 223, 307, 331, 457, 541, 571, 853, 877, 1087, 1297, 1423, 1483, 1621, 1867, 1993, 2683, 3457, 3511, 3691, 3761, 3847, 4513, 4657, 4783, 4951, 5227, 5521, 5647, 5861, 6337, 6547, 6823, 7481, 7541, 7681, 7717, 7753, 7873, 8287, 8521, 8887, 9007, 9397, 10267, 10453
Offset: 1

Views

Author

Claude H. R. Dequatre, Nov 10 2020

Keywords

Comments

Considering the 10^6 sexy prime pairs from (5,11) to (115539653,115539659), we note the following:
65340 sequence terms (6.5%) are linked to a distance between two consecutive sexy prime pairs which is a square.
List of the 16 classes of distances which are squares: 4,16,36,64,100,144,196,256,324,400,484,576,676,784,900,1024.
The frequency of the distances which are squares decreases when their size increases, with a noticeable higher frequency for the distance 36.
First 20 distances which are squares with in parentheses the subtraction of the smallest members of the related two consecutive sexy prime pairs: 4 (11-7), 4 (17-13),4 (41-37),4 (101-97),4 (107-103),4 (227-223),4 (311-307), 16 (347-331),4 (461-457),16 (557-541),16 (587-571),4 (857-853), 4 (881-877), 4 (1091-1087),4 (1301-1297),4 (1427-1423),4 (1487-1483),36 (1657-1621), 4 (1871-1867),4 (1997-1993).

Examples

			a(2)=13 is in the sequence because the two consecutive sexy prime pairs being (13,19) and (17,23),the distance between them is 17-13=4 which is a square (2^2).
73 is not in the sequence because the two consecutive sexy prime pairs being (73,79) and (83,89),the distance between them is 83-73=10 which is not a square.
		

Crossrefs

Programs

  • Maple
    count:= 0: sp:= 5: R:= NULL:
    p:= sp;
    while count < 100  do
        p:= nextprime(p);
        if isprime(p+6) then
          d:= p - sp;
          if issqr(d) then
            count:= count+1; R:= R, sp;
          fi;
          sp:= p;
        fi;
    od:
    R; # Robert Israel, May 08 2024
  • PARI
    lista(nn) = {my(vs = select(x->(isprime(x) && isprime(x+6)), [1..nn]), vd = vector(#vs-1, k, vs[k+1] - vs[k]), vk = select(issquare, vd, 1)); vector(#vk, k, vs[vk[k]]);} \\ Michel Marcus, Nov 14 2020
  • R
    primes<-generate_n_primes(7000000)
    Matrix_1<-matrix(c(primes),nrow=7000000,ncol=1,byrow=TRUE)
    p1<-c(0)
    p2<-c(0)
    k<-c(0)
    distance<-c(0)
    distance_square<-(0)
    Matrix_2<-cbind(Matrix_1,p1,p2,k,distance,distance_square)
    counter=0
    j=1
    while(j<= 7000000){
      p<-(Matrix_2[j,1])+6
      if(is_prime(p)){
        counter=counter+1
        Matrix_2[counter,2]<-(p-6)
        Matrix_2[counter,3]<-p
      }
      j=j+1
    }
    a_n<-c()
    k=1
    while(k<=1000000){
      Matrix_2[k,4]<-k
      dist<-Matrix_2[k+1,2]-Matrix_2[k,2]
      Matrix_2[k,5]<-dist
      if(sqrt(dist)%%1==0){
        Matrix_2[k,6]<-dist
        a_n<-append(a_n,Matrix_2[k,2])
      }
      k=k+1
    }
    View(Matrix_2)
    View(a_n)
    

A053320 Distance between pairs of primes differing by 4.

Original entry on oeis.org

4, 6, 6, 18, 6, 24, 12, 18, 6, 6, 18, 36, 30, 30, 6, 48, 30, 6, 36, 30, 18, 42, 18, 6, 24, 12, 114, 30, 30, 66, 18, 12, 54, 30, 6, 18, 6, 24, 30, 30, 42, 78, 6, 120, 66, 18, 6, 120, 6, 18, 36, 6, 60, 18, 12, 18, 12, 54, 30, 90, 84, 6, 120, 6, 84, 54, 66, 36, 30, 24, 54, 30, 12, 48
Offset: 1

Views

Author

Labos Elemer, Mar 06 2000

Keywords

Crossrefs

First differences of A023200.
Cf. A227346.

Programs

  • Maple
    with(numtheory): pre:=0: for n from 1 to 3000 do if isprime(n) and isprime(n+4) then if pre<>0 then printf("%d, ",n-pre) fi: pre:=n fi od: # C. Ronaldo
  • Mathematica
    Differences[Select[Prime[Range[500]], PrimeQ[# + 4]&]] (* Vincenzo Librandi, Jul 11 2013 *)

A341843 Number of sexy consecutive prime pairs below 2^n.

Original entry on oeis.org

0, 0, 0, 0, 1, 4, 7, 13, 25, 45, 80, 136, 251, 443, 784, 1377, 2420, 4312, 7756, 14106, 25554, 46776, 85774, 157325, 290773, 538520, 1000321, 1861364, 3473165, 6493997, 12167342, 22851920, 42987462, 81018661, 152945700, 289206487, 547722346, 1038786862
Offset: 1

Views

Author

Artur Jasinski, Feb 21 2021

Keywords

Comments

a(n) is the number of pairs of consecutive sexy primes {A023201, A046117} less than 2^n.
For each n from 9 through 48, the most frequently occurring difference between consecutive primes is 6. On p. 108 of the article by Odlyzko et al., the authors estimate that around n=117, the jumping champion (i.e., the most frequently occurring difference between consecutive primes) becomes 30, and around n=1412 it becomes 210. Successive jumping champions are conjecturaly the primorial numbers A002110.
Data for n >= 15 taken from Marek Wolf's prime gaps computation.
For the number of pairs of consecutive primes below 10^n having a difference of 6, see A093738.
For the number of sexy primes less than 10^n, see A080841.
There are 8 known cases in which a power of 2 falls between the members of the sexy consecutive prime pair (see A220951), but if a pair (p, p+6) is such that p < 2^n < p+6, that pair is not counted in a(n).

Examples

			a(6)=4 because 2^6=64 and we have 4 sexy consecutive prime pairs less than 64: {23,29}, {31,37}, {47,53}, {53,59}.
		

Crossrefs

Programs

  • Mathematica
    pp = {}; Do[kk = 0; Do[If[Prime[m + 1] - Prime[m] == 6, kk = kk + 1], {m, 2, PrimePi[2^n] - 1}]; AppendTo[pp, kk], {n, 4, 20}]; pp
Showing 1-3 of 3 results.