A positive integer N can be the LCM (Least Common Multiple) of different set of numbers. For example, LCM (6, 24) = 24, LCM (12, 8) = 24, LCM (1, 2, 3, 4, 8) = 24, etc. For a given number N , maximum sum LCM indicates the set of numbers whose LCM is N and summation is maximum. Let, M SLCM (N ) denote this maximum sum of numbers. Given the value of N you will have to find the value: N ∑ i=2 M SLCM (i) Obviously, in a set the same value never comes twice.
Input file contains at most 200 lines. Each line contains a positive integer which denotes the value of N (1 < N < 20000001). Input is terminated by a line containing a single zero, which should not be processed.
For each positive number N in the input, produce one line of output. This line contains an integer which denotes the value ΣN i=2M SLCM (i)
範例輸入 1
10 1000 0
範例輸出 1
86 823080
Pro 專屬功能: 查看這題在歷屆 CPE 出現過幾次 — 升級以解鎖.