Thread 'Software'

Message boards : Science : Software
Message board moderation

To post messages, you must log in.

AuthorMessage
ProfileNatalia Makarova
Volunteer moderator
Project scientist
Avatar

Send message
Joined: 24 Dec 24
Posts: 259
Credit: 4,980,088
RAC: 30,808
Message 52 - Posted: 16 Jan 2025, 12:02:29 UTC
Last modified: 16 Jan 2025, 12:03:46 UTC

The working program (performing calculations) runs in the PARI/GP software shell.
https://pari.math.u-bordeaux.fr/download.html

The working program is written in the PARI/GP language.
The authors of the program are me and my colleague Sergei Grishin.

I am publishing the text of the work program

{pt=[0, 6, 24, 36, 66, 84, 90, 114, 120, 126, 150, 156, 174, 204, 216, 234,  240];

w=37;
tin = fileopen("in");
  np1=eval(filereadstr(tin));
  np2=eval(filereadstr(tin));
fileclose(tin);

pl=#pt; 
nw=primepi(w);
prs=primes(nw);
period=vecprod(prs);
vp=vector(np2-np1+1, i, period*(np1-1+i)); lvp=#vp;

vmy=vector(40); pat1=vector(17); pat2=vector(17);

lpr=1;
wd=vector(nw);

for( ip=1,nw, 
  rip=[];
  for( r=1,prs[ip]-1,  
    for( i=1,pl, if( (r+pt[i])%prs[ip]==0,  next(2))); 
  rip =concat(rip,r)  ); 
  lpr=lpr*#rip;
  wd[ip]=rip;
); \\for ip

fout = fileopen("out","w");

k=0;
forvec(v=vector(#wd,i,[1,#wd[i]]), k++; 
  form=lift(chinese(  vector( #wd,j,Mod( wd[j][v[j]], prs[j]) )  ));
  
  \\ начало проверки кортежа
  foreach(vp,bpp, 
    bpt=form+bpp; 
  
    if(ispseudoprime(bpt) && ispseudoprime(bpt+240),
      l=0; 
      forprime(p=bpt,bpt+240, l++; vmy[l]=p;  );
      if(l==17, 
      for(m=2,17, pat1[m]=vmy[m]-vmy[1]; );
      pat2=vector(17,i,(pat1[i]==pt[i]));
      vlds=vecsum(pat2);
      if(vlds>10,
        w=strprintf( "%d: %d\nvalids=%d\n",vmy[1],pat1,vlds );
        print(w);
        filewrite(fout,w); 
      );\\if vlds>10
       ); \\ if l==17
        );\\ if ispseudoprime
         );\\ foreach
   \\ конец проверки кортежа

);\\ forvec
w=strprintf("end ");
print(w);
filewrite(fout,w);
fileclose(fout)
}
quit

If you have any suggestions for optimizing the work program, please let me know in this thread or write me a PM.
ID: 52 · Rating: 0 · rate: Rate + / Rate - Report as offensive     Reply Quote
Profileyoyo_rkn

Send message
Joined: 30 Dec 24
Posts: 2
Credit: 374,974
RAC: 1,900
Message 63 - Posted: 19 Jan 2025, 16:31:29 UTC - in response to Message 52.  

As I understand, the "in" file contains somehow the range of the search.
The "out" file somehow the result.
What is the total search range in in which steps?

What does it calculate? Is there some description of the science, maybe a wikipedia link?
ID: 63 · Rating: 0 · rate: Rate + / Rate - Report as offensive     Reply Quote
ProfileNatalia Makarova
Volunteer moderator
Project scientist
Avatar

Send message
Joined: 24 Dec 24
Posts: 259
Credit: 4,980,088
RAC: 30,808
Message 64 - Posted: 20 Jan 2025, 0:50:53 UTC - in response to Message 63.  
Last modified: 20 Jan 2025, 0:57:21 UTC

The main definitions on the topic of the project can be found on the page "Problem 62. Symmetric k-tuples of consecutive primes"
http://www.primepuzzles.net/problems/prob_062.htm

See also
https://en.wikipedia.org/wiki/Prime_k-tuple
https://boinc.mak.termit.me/odlk2025/forum_thread.php?id=3&postid=5

As I understand, the "in" file contains somehow the range of the search.
The "out" file somehow the result.

Yes.

What is the total search range in in which steps?

General search range
(7858321551080267055879090, 557940830126698960967415390).

The task specifies an interval from np1 to np2.

Example WU

1227902370890
1227902370899

This means

np1 = 1227902370890
np2 = 1227902370899

The transition to real numbers of the range is performed according to the formula

from {x} = period*np1 + {d} to {y} = period*np2 + {d},
here
period = 7420738134810 = 37#
{d} – a set of constants calculated using the Chinese remainder theorem.

See more details of the project here
https://boinc.progger.info/odlk/forum_thread.php?id=290
(in Russian)
ID: 64 · Rating: 0 · rate: Rate + / Rate - Report as offensive     Reply Quote
ProfileNatalia Makarova
Volunteer moderator
Project scientist
Avatar

Send message
Joined: 24 Dec 24
Posts: 259
Credit: 4,980,088
RAC: 30,808
Message 65 - Posted: 20 Jan 2025, 1:45:47 UTC

yoyo_rkn
If you still have questions, please ask.
ID: 65 · Rating: 0 · rate: Rate + / Rate - Report as offensive     Reply Quote
Profileyoyo_rkn

Send message
Joined: 30 Dec 24
Posts: 2
Credit: 374,974
RAC: 1,900
Message 67 - Posted: 20 Jan 2025, 19:37:55 UTC

Ok, I read the wikipedia artikel and the German one, https://de.wikipedia.org/wiki/Primzahltupel , explained it for k=2, 3, 4, .... up to 8.
So I think I understood that k consecutive primes should be found, where the difference between the first and last should be minimized.
Sorry, I'm not a math scientist.

And your GP script at the beginning of this thread searches for K=17.
ID: 67 · Rating: 0 · rate: Rate + / Rate - Report as offensive     Reply Quote
ProfileNatalia Makarova
Volunteer moderator
Project scientist
Avatar

Send message
Joined: 24 Dec 24
Posts: 259
Credit: 4,980,088
RAC: 30,808
Message 70 - Posted: 21 Jan 2025, 0:19:00 UTC - in response to Message 67.  

Sorry, I'm not a math scientist.

No problem.

I also recommend you look at the article
https://pzktupel.de/ktpatt_hl.php
ID: 70 · Rating: 0 · rate: Rate + / Rate - Report as offensive     Reply Quote

Message boards : Science : Software

©2025 Natalia Makarova and Co