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 22 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 07:02.

Fri Sep 18 07:02:53 UTC 2020 up 8 days, 4:13, 0 users, load averages: 1.73, 1.63, 1.49

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.