Very nice speedups there! I am too busy to examine the code to see what you've done. Perhaps you could outline the algorithms here? Is n = 3^t-k now slower than n' = 3^t for small k (with k mod 3 != 0)? Then we could zero-pad such operands... -- Torbjörn Please encrypt, key id 0xC8601622