def solution(n):
sum_div = 0
i=1
while(i <= n**0.5) :
if(n%i==0) :
sum_div = sum_div + i + n/i
if(i == n**0.5) :
sum_div = sum_div - i
i+=1
return(sum_div)
function solution(n) {
var answer = 0;
var i=0;
while(i <= Math.sqrt(n)){
if(n%i==0){
answer = answer + i + n/i;
}
if(i == Math.sqrt(n)) {
answer = answer - i;
}
i++;
}
return answer;
}