bil on Mon, 03 Oct 2005 19:32:45 +0200

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

taking polynomials modulo integer

I've not had much experience using gp as yet, but think it's very good.
I now have a problem for which I haven't been able to figure out the
right magic words...
I have a polynomial and wish to square it and take the result modulo
an integer. For example:

	f = x + x^3 + x^7 + x^11

	Mod(f^2, 13)

gives an error message:

  ***   forbidden division t_POL % t_INT.

I need something that will use Fermat's Little Theorem to reduce
the powers to be within the range of the modulus, 
i.e. (x^11)^2 = x^22 == x^10 (mod 13) { using == for congruence symbol}

Can anyone point me at the right function to apply?

Many thanks,

| Bill Purvis, Amateur Mathematician    |
|  email:                  |
|          |