############################################################################ # # This is the code from exercise 2.10.1 # ############################################################################ syl := function(n,p) local divs, lpd, S; divs := Factors(n); lpd := divs[Length(divs)]; divs := Combinations(divs); Add(divs[1],1); divs := List( divs, Product ); S := Filtered( divs, x-> x mod p = 1 and x > lpd ); S := Filtered( S, x -> Gcd( n/x, p-1 ) <> 1 ); return( S ); end;;