/* BC program primepatterns 26-28th March 2014 */ pglobal[0]=2 pglobal[1]=3 pglobal[2]=5 pglobal[3]=7 pglobal[4]=11 pglobal[5]=13 pglobal[6]=17 pglobal[7]=19 pglobal[8]=23 pglobal[9]=29 pglobal[10]=31 pglobal[11]=37 pglobal[12]=41 pglobal[13]=43 pglobal[14]=47 pglobal[15]=53 pglobal[16]=59 pglobal[17]=61 pglobal[18]=67 pglobal[19]=71 nglobal=19 /* this is one less than the number of primes in the above list. */ /* See K. Prachar, Primzahlverteilung, Satz 4.2. p. 45 for the concept of admissible sequence of * primes a[0]m+b[0],...,a[s-1]m+b[s-1]. It was conjectured by L.E. Dickson (1904) that these * numbers will be simultaneously prime for infinitely many m. See Ribenboim, The New Book of * Prime Number Records, p.372. */ define testpattern(a[],b[],s){ auto i,k,count,l,p,m for(i=0;i1){ print "gcd(a[",i,"],b[",i,"])>1\n" return(0) } for(k=0;k=1 such that all of a[i]m+b[i] are > 1. * Then the numbers a[i]m+b[i], 0<=i20){ print "number of linear forms is greater than 20\n" return(-1) } if(testpattern(a[],b[],s)==0){ print "inadmissible test pattern\n" return(-1) } if(u<1||v<1){ print "u < 1 or v< 1\n" return(-1) } if(u>v){ temp=v v=u u=temp } m=1 while(1){ for(i=0;i1){ if(b>0){ print a,"m+",b } if(b<0){ print a,"m",b } if(b==0){ print a,"m" } } if(a==1){ if(b>0){ print "m+",b } if(b<0){ print "m",b } if(b==0){ print "m" } } if(a<-1){ if(b>0){ print a,"m+",b } if(b<0){ print a,"m",b } if(b==0){ print a,"m" } } if(a==-1){ if(b>0){ print "-m+",b } if(b<0){ print "-m",b } if(b==0){ print "-m" } } }