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-1 of 1 results.

A339084 Smaller term p1 of the first of two consecutive cousin prime pairs (p1,p1+4) and (p2,p2+4) such that the distance (p2-p1) is a square.

Original entry on oeis.org

3, 127, 313, 1447, 2203, 2437, 2797, 3217, 4933, 5653, 6007, 7207, 7537, 7603, 7753, 8233, 10627, 11827, 12373, 20353, 22027, 22153, 23017, 23563, 25303, 27697, 27763, 29023, 29059, 29383, 31477, 32323, 32533, 32569, 32839, 33199, 33577, 35533, 36523, 37273, 41077
Offset: 1

Views

Author

Claude H. R. Dequatre, Nov 23 2020

Keywords

Comments

Considering the 10^6 cousin prime pairs from (3,7) to (252115609,252115613), we note the following:
43617 sequence terms (4.4%) are linked to a distance between two consecutive cousin prime pairs which is a square.
List of the 9 classes of distances which are squares: 4,36,144,324,576,900,1296,1764,2304.
The distance 36 occurs with the highest frequency.
Distances linked to the first 50 terms of the sequence: 4,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,324,144,36,36,36,144,144,144,36,36,36,36,36,36,36,36,144,36,144,36,36,36
From the class 36, the frequency of the distances decreases when their size increases; the distance 4 linked to the first term of the sequence occurs only once.
See for comparison the sequence A338812.

Examples

			a(3)=313 is in the sequence because the two consecutive cousin prime pairs being (313,317) and (349,353), the distance between them is 349-313=36 which is a square (6^2).
613 is not in the sequence because the two consecutive cousin prime pairs being (613,617) and (643,647), the distance between them is (643-613)=30 which is not a square.
		

Crossrefs

Programs

  • PARI
    lista(nn) = {my(last=3, p=7); forprime(q=11, nn, if(q-p==4, if (issquare(p-last), print1(last, ", ")); last = p;); p = q;);} \\ Michel Marcus, Nov 23 2020
  • R
    Mat<-matrix(0,14000000,5)
    primes<-generate_n_primes(14000000)
    Mat[,1]<-c(primes)
    a_n<-c()
    Squares<-c()
    Squares_sq<-c()
    j=1
    counter=0
    while(j<=13999999){
      if(is_prime((Mat[j,1])+4) & is_prime((Mat[j+1,1]))+4){
        counter=counter+1
        Mat[counter,2]<-(Mat[j,1])
        Mat[counter,3]<-Mat[j,1]+4
        Mat[counter+1,2]<-(Mat[j+1,1])
        Mat[counter+1,3]<-Mat[j+1,1]+4
      }
      j=j+1
    }
    k=1
    while(k<=1000000){
      dist<- Mat[k+1,2]-Mat[k,2]
      Mat[k,4]<-dist
      if(sqrt(dist)%%1==0){
        Mat[k,5]<-dist
        a_n<-append(a_n,Mat[k,2])
      }
      k=k+1
    }
    View(Mat)
    View(a_n)
    
Showing 1-1 of 1 results.