title: Find Sum Odd Factors Number
signature: class Solution {
  
      public Integer findSumOddFactorsNumber(Integer n) {
test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(Integer n, Integer expected){
          try{
              Driver driver = new Driver();
              if (driver.run(n,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(20, 6);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(6, 4);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(39, 56);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(80, 6);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(88, 12);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(7, 8);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(16, 1);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(27, 40);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(83, 84);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(6, 4);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(Integer n, Integer expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(n),expected);
      }
      
      public boolean validateSolution(Integer actual, Integer expected){
          return actual.equals(expected);
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
source_py: def find_sum_odd_factors_number(n):
      res = 1
      while ((n % 2) == 0):
          n = (n // 2)
      for i in range(3, int((math.sqrt(n) + 1))):
          count = 0
          curr_sum = 1
          curr_term = 1
          while ((n % i) == 0):
              count += 1
              n = (n // i)
              curr_term *= i
              curr_sum += curr_term
          res *= curr_sum
      if (n >= 2):
          res *= (1 + n)
      return res
source_cpp: int find_sum_odd_factors_number(int n) {
    int res = 1;
    while ( n % 2 == 0 ) n = n / 2;
    for ( int i = 3;
    i <= sqrt ( n );
    i ++ ) {
      int count = 0, curr_sum = 1;
      int curr_term = 1;
      while ( n % i == 0 ) {
        count ++;
        n = n / i;
        curr_term *= i;
        curr_sum += curr_term;
      }
      res *= curr_sum;
    }
    if ( n >= 2 ) res *= ( 1 + n );
    return res;
  }