title: Sum Factors Number
signature: func sumFactorsNumber(n int) int {
test_code: package main
  
  import (
      "fmt"
      "reflect"
      "math"
      "sort"
  )
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  func validateSolution(actual int, expected int) bool {
      return reflect.DeepEqual(actual,expected)
  }
  
  func driver(n int, expected int) string {
      if validateSolution(PLACEHOLDER_FN_NAME(n),expected) {
              return "PASSED"
      }
      return "FAILED"
  
  }
  
  func main() {
  
      // Use imports to avoid undefined errors
      var _ = reflect.DeepEqual
      _ = math.Abs
      _ = sort.Sort
      result := ""
      result = driver(76, 140)
      fmt.Printf("TEST-0...%s\n", result)
      
      result = driver(21, 32)
      fmt.Printf("TEST-1...%s\n", result)
      
      result = driver(4, 7)
      fmt.Printf("TEST-2...%s\n", result)
      
      result = driver(49, 57)
      fmt.Printf("TEST-3...%s\n", result)
      
      result = driver(35, 48)
      fmt.Printf("TEST-4...%s\n", result)
      
      result = driver(55, 72)
      fmt.Printf("TEST-5...%s\n", result)
      
      result = driver(43, 44)
      fmt.Printf("TEST-6...%s\n", result)
      
      result = driver(39, 56)
      fmt.Printf("TEST-7...%s\n", result)
      
      result = driver(36, 91)
      fmt.Printf("TEST-8...%s\n", result)
      
      result = driver(5, 6)
      fmt.Printf("TEST-9...%s\n", result)
      
          
  }
source_py: def sum_factors_number(n):
      result = 0
      for i in range(2, (int(math.sqrt(n)) + 1)):
          if ((n % i) == 0):
              if (i == (n / i)):
                  result = (result + i)
              else:
                  result = (result + (i + (n // i)))
      return ((result + n) + 1)
source_cpp: int sum_factors_number(int n) {
    int result = 0;
    for ( int i = 2;
    i <= sqrt ( n );
    i ++ ) {
      if ( n % i == 0 ) {
        if ( i == ( n / i ) ) result += i;
        else result += ( i + n / i );
      }
    }
    return ( result + n + 1 );
  }