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.

A052239 Smallest prime p in set of 4 consecutive primes in arithmetic progression with common difference 6n.

Original entry on oeis.org

251, 111497, 74453, 1397609, 642427, 5321191, 23921257, 55410683, 400948369, 253444777, 1140813701, 491525857, 998051413, 2060959049, 4480114337, 55140921491, 38415872947, 315392068463, 15162919459, 60600021611, 278300877401, 477836574947, 1486135570643
Offset: 1

Views

Author

Labos Elemer, Jan 31 2000

Keywords

Comments

See also the less restrictive A054701 where the gaps are multiples 6n. - M. F. Hasler, Nov 06 2018

Examples

			a(5) = 642427, 642457, 642487, 642517 are the smallest consecutive primes with 3 consecutive gaps of 30, cf. A052243.
From _M. F. Hasler_, Nov 06 2018: (Start)
Other terms are also initial terms of corresponding sequences:
a(1) = 251 = A033451(1) = A054800(1), start of first CPAP-4 with common gap of 6,
a(2) = 111497 = A033447(1), start of first CPAP-4 with common gap of 12,
a(3) = 74453 = A033448(1) = A054800(25), first CPAP-4 with common gap of 18,
a(4) = 1397609 = A052242(1), start of first CPAP-4 with common gap of 24,
a(5) = 642427 = A052243(1) = A052195(16), first CPAP-4 with common gap of 30,
a(6) = 5321191 = A058252(1) = A161534(26), first CPAP-4 with common gap 36 = 6^2,
a(7) = 23921257 = A058323(1), start of first CPAP-4 with common gap of 42,
a(8) = 55410683 = A067388(1), start of first CPAP-4 with common gap of 48,
a(9) = 400948369 = A259224(1), start of first CPAP-4 with common gap of 54,
a(10) = 253444777 = A210683(1) = A089234(417), CPAP-4 with common gap of 60,
a(11) = 1140813701 = A287547(1), start of first CPAP-4 with common gap of 66,
a(12) = 491525857 = A287550(1), start of first CPAP-4 with common gap of 72,
a(13) = 998051413 = A287171(1), start of first CPAP-4 with common gap of 78,
a(14) = 2060959049 = A287593(1), start of first CPAP-4 with common gap of 84,
a(15) = 4480114337 = A286817(1) = A204852(444), common distance 90. (End)
		

Crossrefs

Range is a subset of A054800: start of 4 consecutive primes in arithmetic progression (CPAP-4).
Cf. A054701: gaps are possibly distinct multiples of 6n (not CPAP's).

Programs

  • Mathematica
    Transpose[Flatten[Table[Select[Partition[Prime[Range[2000000]],4,1], Union[ Differences[ #]] =={6n}&,1],{n,7}],1]][[1]] (* Harvey P. Dale, Aug 12 2012 *)
  • PARI
    a(n, p=[2, 0, 0], d=6*[n, n, n])={while(p+d!=p=[nextprime(p[1]+1), p[1], p[2]], ); p[3]-d[3]} \\ after M. F. Hasler in A052243; Graziano Aglietti (mg5055(AT)mclink.it), Aug 22 2010, Corrected by M. F. Hasler, Nov 06 2018
    
  • PARI
    A052239(n, p=2, c, o)={n*=6; forprime(q=p+1, , if(p+n!=p=q, next, q!=o+2*n, c=2, c++>3, break); o=q-n); o-n} \\ M. F. Hasler, Nov 06 2018

Extensions

More terms from Labos Elemer, Jan 04 2002
a(7) corrected and more terms added by Graziano Aglietti (mg5055(AT)mclink.it), Aug 22 2010
a(15)-a(20) from Donovan Johnson, Oct 05 2010
a(21)-a(23) from Donovan Johnson, May 23 2011

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)
    

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