http://www.perlmonks.org?node_id=250312


in reply to Re^2: Coming soon: Algorithm::Loops (restrictions)
in thread Coming soon: Algorithm::Loops

But with a quick change of a couple of characters, I see that adding up two 4-digit numbers (having the same digits in different orders) never gives us 2003. But of course it can't, because all such would be even modulo 9 while 2003 is odd modulo 9.

Careful now, 7 * 2 = 14 == 5 (modulo 9).

In general (if I remember correctly), for any modulus q, if a does not share a factor with q there exists a b for every c such that a * b == c (modulo q).

Hugo
  • Comment on Re: Re^2: Coming soon: Algorithm::Loops (restrictions)