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.

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)