[was@laptop mlogs]$ [was@laptop mlogs]$ Magma V2.9-11 Fri Oct 4 2002 10:45:52 on laptop [Seed = 1724314285] Type ? for help. Type -D to quit. Loading startup file "/home/was/magma/local/emacs.m" Loading "/home/was/magma/local/init.m" > R := Integers(389); > R; Residue class ring of integers modulo 389 > a := R!69; > a^((389-1)/2); >> a^((389-1)/2); ^ Runtime error in '^': Bad argument types Argument types given: RngIntResElt, FldRatElt > n := (389-1)/2; > n; 194 > Parent(n); Rational Field > 4/3; 4/3 > 4 div 3; 1 > a^((389-1) div 2); 1 > n; 194 > n := Integers()!n; > a^n; 1 > R; Residue class ring of integers modulo 389 > > > Z389 := Integers(389); > S := PolynomialRing(Z389); > S; Univariate Polynomial Ring in x over IntegerRing(389) > R := quo; > R; Univariate Quotient Polynomial Algebra in x over Residue class ring of integers modulo 389 with modulus x^2 + 320 > Random(389); 255 > z := 255; > (1+z*x)^((389-1) div 2); 150*x > u := Z389!0; v := Z389!150; > -u/v; 0 > (1-u)/v; 236 > ((1-u)/v)^2; 69 > (-1-u)/v; 153 > ((-1-u)/v)^2; 69 > for z in [1..388] do (1+z*x)^((389-1) div 2); end for; 388 388 150*x 388 388 239*x 1 239*x 1 239*x 388 388 239*x 150*x 388 150*x 239*x 150*x 150*x 388 1 388 1 388 1 150*x 388 1 1 1 1 388 1 150*x 388 239*x 1 239*x 239*x 388 388 388 150*x 239*x 388 150*x 388 239*x 388 239*x 239*x 150*x 239*x 239*x 1 1 239*x 150*x 1 150*x 150*x 388 1 1 239*x 150*x 388 150*x 239*x 1 1 239*x 1 239*x 150*x 239*x 239*x 388 388 150*x 239*x 1 239*x 239*x 239*x 1 239*x 239*x 150*x 388 239*x 239*x 388 388 1 1 150*x 1 150*x 388 239*x 150*x 388 239*x 239*x 1 388 239*x 239*x 150*x 388 150*x 388 1 239*x 388 150*x 150*x 150*x 1 388 1 388 388 1 1 150*x 150*x 388 239*x 239*x 388 1 239*x 388 388 1 388 1 150*x 239*x 150*x 1 1 1 1 388 150*x 239*x 314*x + 194 239*x 150*x 150*x 1 239*x 239*x 239*x 150*x 1 150*x 1 150*x 1 388 150*x 1 239*x 388 239*x 1 150*x 150*x 150*x 1 1 150*x 150*x 239*x 388 1 150*x 388 388 150*x 1 239*x 150*x 388 388 150*x 239*x 239*x 150*x 1 1 239*x 150*x 150*x 239*x 388 388 239*x 150*x 1 239*x 388 388 239*x 1 388 150*x 239*x 239*x 1 1 239*x 239*x 239*x 1 150*x 388 150*x 1 239*x 388 1 239*x 1 239*x 1 239*x 150*x 150*x 150*x 1 239*x 239*x 150*x 75*x + 194 150*x 239*x 388 1 1 1 1 239*x 150*x 239*x 1 388 1 388 388 150*x 1 388 150*x 150*x 388 239*x 239*x 1 1 388 388 1 388 1 239*x 239*x 239*x 388 150*x 1 388 239*x 388 239*x 150*x 150*x 388 1 150*x 150*x 388 239*x 150*x 388 239*x 1 239*x 1 1 388 388 150*x 150*x 388 239*x 150*x 150*x 1 150*x 150*x 150*x 1 150*x 239*x 388 388 150*x 150*x 239*x 150*x 1 150*x 1 1 150*x 239*x 388 239*x 150*x 1 1 388 239*x 239*x 1 239*x 150*x 1 1 150*x 150*x 239*x 150*x 150*x 388 150*x 388 239*x 388 150*x 239*x 388 388 388 150*x 150*x 1 150*x 388 239*x 1 388 1 1 1 1 388 239*x 1 388 1 388 1 388 239*x 239*x 150*x 239*x 388 239*x 150*x 388 388 150*x 1 150*x 1 150*x 388 388 239*x 388 388 > s := 0; for z in [1..388] do if Coefficient((1+z*x)^((389-1) div 2),1) ne 0 then s:= s +1; end for; >> 89-1) div 2),1) ne 0 then s:= s +1; end for; ^ User error: bad syntax > s := 0; for z in [1..388] do if Coefficient((1+z*x)^((389-1) div 2),1) ne 0 then s:= s +1; end if; end for; > s; 196 > s*2; 392 > s := 0; for z in [1..388] do if Coefficient((1+z*x)^((389-1) div 2),1) eq 0 then s:= s +1; end if; end for; > s; 192 > 192+196; 388 > s := 0; for z in [1..388] do if Coefficient((1+z*x)^((389-1) div 2),0) eq 0 then s:= s +1; end if; end for; > s; 194 > 194 + 192; 386 >