6 /* 0 and 1 are not primes */
19 /* this are checkd from the list of small primes */
26 /* this is the deterministic primality test */
30 primep(5178997768267);
33 next_prime(100002100000);
36 prev_prime(100002100042);
46 [[2,4],[3,4],[5,2],[7,1]];
48 /* limiting to factors */
49 ev( ifactors(226800), factors_only:true );
52 /* this should be found by Pollard rho */
53 ifactors(5178997768267);
54 [[183823,1],[28173829,1]];
56 /* disable Pollard rho to test ECM */
57 (save_prt : pollard_rho_tests, pollard_rho_tests : 0);
60 /* this should be found by ECM */
61 ifactors(5178997768267);
62 [[183823,1],[28173829,1]];
64 (pollard_rho_tests : save_prt, 0);
67 /* MODULAR POWERS AND INVERSE */
69 power_mod(2^64,2,2^64-2^34+1);
72 inv_mod(42,2^64-2^34+1);
75 /* negative exponents */
82 power_mod(2^64,-2,2^64-2^34+1);
85 inv_mod(2^128,2^64-2^34+1);