A140382 Duplicate of A094343.
3, 7, 7, 11, 13, 17, 19, 23, 37, 41, 43, 47, 67, 71, 79, 83, 97
Offset: 1
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.
The pairs are (3, 17), (5, 19), (17, 31) etc.
Flatten[{#,#+14}&/@Select[Prime[Range[100]],PrimeQ[#+14]&]] (* Harvey P. Dale, Nov 14 2024 *)
The pairs are (7, 29), (19, 41), (31, 53) etc.
{#, # + 22} & /@ Select[Prime@ Range@ 100, PrimeQ@ # && PrimeQ[# + 22] &] // Flatten (* Michael De Vlieger, May 23 2016 *)
require 'prime' ary = [] Prime.each(487447).each{|i| ary += [i, i + 22] if (i + 22).prime?} p ary # Seiichi Manyama, May 22 2016
i: 1: for k from 1 to 1200 do if isprim (k) and isprim (k+10) then a [ i ] : = k : a [ i + 1]: = k + 10 : i = i + 2 fi od : seq (a [ n ], n=1..i-1);
Flatten[{#,#+10}&/@Select[Prime[Range[100]],PrimeQ[#+10]&]] (* Harvey P. Dale, Apr 11 2011 *)
The prime pairs are (3, 19), (7, 23), (13, 29) etc.
&cat [[p,p+16]: p in PrimesUpTo(1000) | IsPrime(p+16)];
Flatten[{#, # + 16}&/@Select[Prime[Range[200]], PrimeQ[# + 16] &]]
The prime pairs are (3, 23), (11, 31), (17, 37) etc.
&cat [[p, p+20]: p in PrimesUpTo(1000) | IsPrime(p+20)];
Flatten[{#, # + 20}&/@Select[Prime[Range[200]], PrimeQ[# + 20] &]]
from gmpy2 import is_prime for n in range(1000): if(is_prime(n) and is_prime(n+20)): print('{}, {}'.format(n,n+20),end=', ') # Soumil Mandal, May 14 2016
Flatten[Select[Partition[Prime[Range[200]],2,1],#[[2]]-#[[1]]==4&]]//Union (* Harvey P. Dale, Jul 09 2024 *)
The pairs are (3, 37), (7, 41), (13, 47), etc.
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.
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
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)
Comments