Talk:Euler's sum of powers conjecture

From Rosetta Code
Revision as of 17:21, 8 July 2015 by Rdm (talk | contribs) (→‎Fermat's little theorem?: new section)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Fermat's little theorem?

The C and C++ entries mention Fermat's little theorem. And it's true that Fermat's little theorem gives us ((x^5)modulo 5) = (x modulo 5).

However, Fermat's little theorem does not show that ((x^5)modulo 3) = (x modulo 3) nor that ((x^5)modulo 2) = (x modulo 2).

The modulo 2 one is obvious - an odd number to any positive integer power will still be odd, and an even number to any positive integer power will still be even. That's not Fermat's little theorem. It might be possible to derive this from Fermat's little theorem? I would be interested in seeing that derivation.

The modulo 3 expression, though, seems a bit more obscure. How does that work?

(Reading that code, I'm having trouble deciding whether it could work for arbitrarily large values of N.) --Rdm (talk) 17:21, 8 July 2015 (UTC)