Re: Mathematica: Modular arithmetic with nonnumber
- To: mathgroup at smc.vnet.net
- Subject: [mg35151] Re: [mg35144] Mathematica: Modular arithmetic with nonnumber
- From: Andrzej Kozlowski <andrzej at lineone.net>
- Date: Thu, 27 Jun 2002 00:23:12 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Indeed there si a function that does exactly what you want: In[4]:= PolynomialMod[11 e[6],7] Out[4]= 4 e[6] Andrzej Kozlowski Toyama International University JAPAN http://platon.c.u-tokyo.ac.jp/andrzej/ On Wednesday, June 26, 2002, at 08:56 AM, Geoff Tims wrote: > I have a function which takes in and gives out numbers such as > > 3e[2] + 3e[4] > > In other words, these are integer multiples of basis vectors. Now, I > want > to be able to take any arbitrary vector mod p, for some prime p. The > problem is that if I do > > Mod[11e[6],7] > > Mathematica sees 11e[6] as a noninteger and thus doesn't do modular > arithmetic on it. > > Is there some way to do this? One thought I had was to have some > function > which strips 11e[6] down to 11 and then does modular arithmetic. That > would > be good enough for me because I'm trying to figure out if all values > are 0 > or if they are not. If I end up with a 4 instead of 4e[6], I still > know it > isn't 0. However, I don't know how to do that and if there's a faster > way, > that would be useful in my program as it might do lots of calculations. > > Any help would be wonderful > Thanks > Geoff Tims > > > > >