MathCastle
Number TheorySuperchallengeFermat, Euler and Wilson

Fermat, Euler and Wilson · Superchallenge problem

A composite number nn is a Carmichael number if an≡a(modn)a^n \equiv a \pmod n for every integer aa. Korselt's criterion says: nn is a Carmichael number exactly when nn is squarefree and p−1p - 1 divides n−1n - 1 for every prime pp dividing nn. Find the sum of all Carmichael numbers of the form n=7⋅13⋅pn = 7 \cdot 13 \cdot p, where pp is a prime different from 77 and 1313.