Anonymous user
Factors of a Mersenne number: Difference between revisions
→[[Trial factoring of a Mersenne number#ALGOL 68]]
(→[[Trial_factoring_of_a_Mersenne_number#ALGOL 68]]: link to "pow_mod.a68" prelude) |
|||
Line 25:
<!-- {{works with|ELLA ALGOL 68|Any (with appropriate job cards) - tested with release 1.8.8d.fc9.i386}}
Compiles, but I couldn't maxint not in library, works with manually entered maxint, bits width. Leaving some issue with newline -->
<lang algol>
PR READ "prelude/is_prime.a68" PR;
MODE POWMODSTRUCT = INT;
Line 40 ⟶ 39:
OD;
max k := ENTIER sqrt(max int) OVER p;
FOR k FROM 1 TO max k DO
q := 2*p*k + 1;
Line 51 ⟶ 50:
IF n = 1 THEN
m factor := q;
FI
FI
|