> with(numtheory): Warning, the protected name order has been redefined and unprotected > n:=1234567; n := 1234567 > k:=987; k := 987 > r:=irem(n,k,'q'); r := 817 > q; 1250 > n mod k; 817 > ifactor(n); (127) (9721) > isprime(n); false > S:={2}: > for n from 3 to 200 by 2 do > if isprime(n) then S:=S union {n}: > end if: > end do: > S; {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199} > n_primes:=nops(S); n_primes := 46 > S:=S minus {2}; S := {3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199} > S1:={}: S2:={}: > for p in S do > if p mod 4 = 1 then S1:=S1 union {p} > else S2:=S2 union {p} > end if: > end do: > nops(S1); 21 > nops(S2); 24 > ################# > p:=11: > a:=2: > a&^(p-1) mod p; 1 > order(a,p); 10 > b:=3; b := 3 > order(b,p); 5 > b&^5 mod p; 1 >