> What does your code say about m = 1001 = 7 * 11 * 13 ? Especially, what does it say for that M, when K reaches 9788349978563 ? (That would be a good double-check; but I don't know whether Maple can do that binomial modulo M.) -- Don Reble djr at nk.ca