Mathematics

Mathematics

Problem

For a positive integer nn, let R(n)R(n) be the sum of the remainders when nn is divided by 1,2,…,n1, 2, \dots, n. For example, R(4)=0+0+1+0=1R(4) = 0 + 0 + 1 + 0 = 1, R(7)=0+1+1+3+2+1+0=8R(7) = 0 + 1 + 1 + 3 + 2 + 1 + 0 = 8. Find all positive integers nn such that R(n)=n−1R(n) = n - 1 .

Browse the problem library