From: Harry Ohlsen Date: 2003-07-01T19:52:35+09:00 Subject: Terribly OT ... Given that we're talking about modulo arithmetic :-) ... I'm sitting here trying to write some Ruby code that generates the "magic table" from the remainders that pop up when executing Euclid's algorithm. I don't suppose anyone happens to remember how that works? I'm writing the Ruby partly to remind myself of the number theory, but with the intention of producing something that my old lecturer might be able to use to allow him to easily come up with new tutorial, quiz and assignment questions, without having to slog through the calculations. You can see an example of such a table in the solution to question 7, part (b) in the following PDF ... http://www.maths.usyd.edu.au:8000/u/terry/3009/02nt01s.pdf I remember it has to do with multiplying two diagonal elements then adding one on the left, but can't for the life of me work out which ones !! Cheers, Harry O.