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.
%I A338812 #33 May 08 2024 23:08:45 %S A338812 7,13,37,97,103,223,307,331,457,541,571,853,877,1087,1297,1423,1483, %T A338812 1621,1867,1993,2683,3457,3511,3691,3761,3847,4513,4657,4783,4951, %U A338812 5227,5521,5647,5861,6337,6547,6823,7481,7541,7681,7717,7753,7873,8287,8521,8887,9007,9397,10267,10453 %N A338812 Smaller term of a pair of sexy primes (A023201) such that the distance to next pair (A227346) is a square. %C A338812 Considering the 10^6 sexy prime pairs from (5,11) to (115539653,115539659), we note the following: %C A338812 65340 sequence terms (6.5%) are linked to a distance between two consecutive sexy prime pairs which is a square. %C A338812 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. %C A338812 The frequency of the distances which are squares decreases when their size increases, with a noticeable higher frequency for the distance 36. %C A338812 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). %H A338812 Robert Israel, <a href="/A338812/b338812.txt">Table of n, a(n) for n = 1..10000</a> %e A338812 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). %e A338812 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. %p A338812 count:= 0: sp:= 5: R:= NULL: %p A338812 p:= sp; %p A338812 while count < 100 do %p A338812 p:= nextprime(p); %p A338812 if isprime(p+6) then %p A338812 d:= p - sp; %p A338812 if issqr(d) then %p A338812 count:= count+1; R:= R, sp; %p A338812 fi; %p A338812 sp:= p; %p A338812 fi; %p A338812 od: %p A338812 R; # _Robert Israel_, May 08 2024 %o A338812 (R) %o A338812 primes<-generate_n_primes(7000000) %o A338812 Matrix_1<-matrix(c(primes),nrow=7000000,ncol=1,byrow=TRUE) %o A338812 p1<-c(0) %o A338812 p2<-c(0) %o A338812 k<-c(0) %o A338812 distance<-c(0) %o A338812 distance_square<-(0) %o A338812 Matrix_2<-cbind(Matrix_1,p1,p2,k,distance,distance_square) %o A338812 counter=0 %o A338812 j=1 %o A338812 while(j<= 7000000){ %o A338812 p<-(Matrix_2[j,1])+6 %o A338812 if(is_prime(p)){ %o A338812 counter=counter+1 %o A338812 Matrix_2[counter,2]<-(p-6) %o A338812 Matrix_2[counter,3]<-p %o A338812 } %o A338812 j=j+1 %o A338812 } %o A338812 a_n<-c() %o A338812 k=1 %o A338812 while(k<=1000000){ %o A338812 Matrix_2[k,4]<-k %o A338812 dist<-Matrix_2[k+1,2]-Matrix_2[k,2] %o A338812 Matrix_2[k,5]<-dist %o A338812 if(sqrt(dist)%%1==0){ %o A338812 Matrix_2[k,6]<-dist %o A338812 a_n<-append(a_n,Matrix_2[k,2]) %o A338812 } %o A338812 k=k+1 %o A338812 } %o A338812 View(Matrix_2) %o A338812 View(a_n) %o A338812 (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 %Y A338812 Cf. A023201, A046117,A227346, A000290, A161002, A161533, A161534, A138198. %K A338812 nonn,easy %O A338812 1,1 %A A338812 _Claude H. R. Dequatre_, Nov 10 2020