← Complete problem index

PROJECT EULER · #0536

Modulo Power Identity

Statement only · UnsolvedOriginal problem ↗

Let S(n) be the sum of all positive integers m not exceeding n having the following property:
am+4a(modm) for all integers a.

The values of m100 that satisfy this property are 1,2,3,5 and 21, thus S(100)=1+2+3+5+21=32.
You are given S(106)=22868117.

Find S(1012).

Write-up coming later

The complete problem is available here. An approach, code, and answer will be added later.