2018-05-28, 13:55 | #1 |
Jul 2015
4_{8} Posts |
algorithm for factoring a number into two factors
var k,l,n,s,j,d,c,y,r,b:biginteger;
begin var x:=ReadString('введите число:').ToBigInteger; var a:=x div 2; repeat b:=a; a:=(a+x div a)div 2 until a>=b; 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; writeln('l=',l); writeln ('s=',s); end. |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
New Factoring Algorithm | GreasyScooby | Factoring | 4 | 2018-04-27 13:48 |
Number of distinct prime factors of a Double Mersenne number | aketilander | Operazione Doppi Mersennes | 1 | 2012-11-09 21:16 |
Estimating the number of prime factors a number has | henryzz | Math | 7 | 2012-05-23 01:13 |
Prime Factoring Algorithm | Visu | Math | 66 | 2008-05-12 13:55 |
Faster Factoring Algorithm? | Citrix | Factoring | 6 | 2007-12-23 11:36 |