Computing $-\frac{655}{8}$ modulo 35 efficiently in Magma (CAS)

549 Views Asked by At

Modexp$(-81.875,1,35);$ will not work.

So what I have to do is the following:

  1. Modexp$(-81,1,35); = 24$

  2. $875/1000; = 7/8$

  3. Modexp$(24*7,1,35); = 28$

  4. Modexp$(8,-1,35); = 22$

  5. Modexp$(22*28,1,35); = 21 \equiv −81.875 \mod 35$

But there has to be a more efficient way of calculuting $-\frac{655}{8}$ mod $35$. Does anyone know how that might be?

EDIT: Read comments below for correction.

2

There are 2 best solutions below

0
On BEST ANSWER

Magma can be quite picky about where your objects live. Though in this case, I can hardly blame it---why would you enter this number as the decimal $-81.875$, which will be treated as an element of a precision field, rather than the exact $-655/8$? Here's what I typed into Magma:

R := Integers(35);

R;

Residue class ring of integers modulo 35

R!-655/8;

10

The ! is used to coerce $-655/8$ into the ring $R$.

4
On

In Mathematica, the particular type of computation you are looking for is done with the syntax PolynomialMod[-655/8, 35]. In Magma, I don't know, because I don't use it.