rank0001

Untitled

Nov 25th, 2021
463
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import math
  2. def divSum(num) :
  3.    
  4.     result = 0
  5.     i = 2
  6.     while i<= (math.sqrt(num)) :
  7.    
  8.         if (num % i == 0) :
  9.    
  10.             if (i == (num / i)) :
  11.                 result = result + i;
  12.             else :
  13.                 result = result + (i + num/i);
  14.         i = i + 1
  15.        
  16.     return (result + 1)+num;
  17.  
  18. num = int(input())
  19. a = divSum(num)
  20. print(int(a))
  21.  
  22.  
  23.  
RAW Paste Data