mersenneforum.org Mersenne prime number search algorithm
 Register FAQ Search Today's Posts Mark Forums Read

 2018-05-28, 13:57 #1 irina   Jul 2015 48 Posts Mersenne prime number search algorithm 1. var k,l,n,s,j,d,c,y,r,x,i,h:biginteger; begin x:=31; i:=32; h:=1; for var q:=1 to 100 do begin var a:=x div 2; var b:=a-1; repeat b:=a; a:=(a+x div a)div 2 until a>=b; writeln; s:=a; n:=x-sqr(s); k:=n div s; j:=n mod s; l:=s+k; d:= s-j; repeat s:=s-1; d:=d-1; r:=l-d; c:=r div s; y:=r mod s; l:=l+1+c; j:=y; d:=s-j; until j=0; if (l=1) or (s=1) then writeln (x); x:=x+i*63*h; i:=i*32; h:=h*2; end; end. 2.var k,l,n,s,j,d,c,y,r,x,i:biginteger; q:integer; begin x:=127; i:=64; for q:=1 to 100 do begin var a:=x div 2; var b:=a-1; repeat b:=a; a:=(a+x div a)div 2 until a>=b; writeln; s:=a; n:=x-sqr(s); k:=n div s; j:=n mod s; l:=s+k; d:= s-j; repeat s:=s-1; d:=d-1; r:=l-d; c:=r div s; y:=r mod s; l:=l+1+c; j:=y; d:=s-j; until j=0; if (l=1) or (s=1) then writeln (x); x:=x+i*126; i:=i*64; end; end.
2018-05-29, 05:39   #2
ONeil

Dec 2017

2·5·11 Posts

Quote:
 Originally Posted by irina 1. var k,l,n,s,j,d,c,y,r,x,i,h:biginteger; begin x:=31; i:=32; h:=1; for var q:=1 to 100 do begin var a:=x div 2; var b:=a-1; repeat b:=a; a:=(a+x div a)div 2 until a>=b; writeln; s:=a; n:=x-sqr(s); k:=n div s; j:=n mod s; l:=s+k; d:= s-j; repeat s:=s-1; d:=d-1; r:=l-d; c:=r div s; y:=r mod s; l:=l+1+c; j:=y; d:=s-j; until j=0; if (l=1) or (s=1) then writeln (x); x:=x+i*63*h; i:=i*32; h:=h*2; end; end. 2.var k,l,n,s,j,d,c,y,r,x,i:biginteger; q:integer; begin x:=127; i:=64; for q:=1 to 100 do begin var a:=x div 2; var b:=a-1; repeat b:=a; a:=(a+x div a)div 2 until a>=b; writeln; s:=a; n:=x-sqr(s); k:=n div s; j:=n mod s; l:=s+k; d:= s-j; repeat s:=s-1; d:=d-1; r:=l-d; c:=r div s; y:=r mod s; l:=l+1+c; j:=y; d:=s-j; until j=0; if (l=1) or (s=1) then writeln (x); x:=x+i*126; i:=i*64; end; end.
Can you possibly program this in python?

2018-05-30, 13:33   #3
BudgieJane

"Jane Sullivan"
Jan 2011
Beckenham, UK

2×32×13 Posts

Quote:
 Originally Posted by ONeil Can you possibly program this in python?
Surely that is left as an exercise for the reader?

 Similar Threads Thread Thread Starter Forum Replies Last Post Taiy Hardware 12 2018-01-02 15:54 Ammonia Hardware 2 2016-01-21 17:46 Jonathan Data 3 2015-07-03 01:27 aketilander Operazione Doppi Mersennes 1 2012-11-09 21:16 Unregistered Information & Answers 22 2012-03-20 11:38

All times are UTC. The time now is 02:38.

Tue Oct 20 02:38:13 UTC 2020 up 39 days, 23:49, 0 users, load averages: 2.18, 2.03, 1.89