title: Find Sum Odd Factors Number
signature: find_sum_odd_factors_number <- function(n) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      toString(actual)==toString(expected)
  }
  
  driver <- function(n, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(n), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          20L, 
          6L
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          6L, 
          4L
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          39L, 
          56L
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          80L, 
          6L
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          88L, 
          12L
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          7L, 
          8L
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          16L, 
          1L
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          27L, 
          40L
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          83L, 
          84L
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          6L, 
          4L
      )))
  
  }
  
  main()
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;
  }