Problem 447: Retractions C

FCC link

For every integer n>1, the family of functions fn,a,b is defined

by fn,a,b(x)≡ax+b mod n for a,b,x integer and 0

F(N)=∑R(n) for 2≤n≤N. F(107)≡638042271 (mod 1 000 000 007).

Find F(1014) (mod 1 000 000 007).

Test

{{test}}

Console output