P536
projecteuler.net

Modulo Power Identity

ℹ️Published on Saturday, 28th November 2015, 07:00 pm; Solved by 327;
Difficulty rating: 60%

Let $S(n)$ be the sum of all positive integers $m$ not exceeding $n$ having the following property:
$a^{m + 4} \equiv a \pmod m$ for all integers $a$.

The values of $m \le 100$ that satisfy this property are $1, 2, 3, 5$ and $21$, thus $S(100) = 1+2+3+5+21 = 32$.
You are given $S(10^6) = 22868117$.

Find $S(10^{12})$.



Soluzione

Last modified: May 01, 2025. Website built with Franklin.jl and the lovely Julia programming language.