NNN이하의 수 중에서 약수가 iii인 개수: ⌊Ni⌋\lfloor \frac{N}{i}\rfloor⌊iN⌋이므로 ∑i=1Ni⌊Ni⌋\sum\limits_{i=1}^{N}i \lfloor\frac{N}{i}\rfloori=1∑Ni⌊iN⌋을 구하면 된다.
import sys #sys.stdin = open('input.txt', 'r') input = sys.stdin.readline N = int(input()) answer = 0 for i in range(1, N + 1): answer += (N // i) * i print(answer)