<snip> > > I originally was trying to think if there was an easy way to > get there from > any number's residual, but then it becomes a hassle. > > On another note, I was thinking last night about a totally different > approach, and would appreciate it if some math modulo guru > out there could > explain how to go from something like: > > (2^7+2^6+2)%(2^5-1) = 2^3 > or how > (2^12+2^8+2^7+2^2+2+1)%(2^7-1) = 2^5+2^3+2 > > without actually figuring out the number represented. I know > that 2^7+2^6+2 > = 194 and could then take the modulus from there... but that > defeats the > purpose. :) > Okay, so I got out my pen and paper and actually put some thought into it. (2^7+2^6+2)%(2^5-1) = 2+6 (2^7+2^6)/2^5 = 2^2+2 = 6 Thus (2^7+2^6+2)-6(2^5-1) = 2+6 and: (2^12+2^8+2^7+2^2+2+1)%(2^7-1) = 2^2+2+35 (2^12+2^8+2^7)/2^7 = 2^5+2^1+2^0 = 35 Thus (2^12+2^8+2^7+2^2+2+1)-35(2^7-1) = 2^2+2+1+35 Any thoughts as to doing the modulo a different way would be appreciated. ________________________________________________________________ Unsubscribe & list info -- http://www.scruz.net/~luke/signup.htm
