title: Sum Subsets Set Formed First N Natural Numbers
signature: sum_subsets_set_formed_first_n_natural_numbers <- function(n) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      abs(actual - expected) < 1e-09
  }
  
  driver <- function(n, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(n), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          26L, 
          11777605632.0
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          35L, 
          10823317585920.0
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          34L, 
          5111011082240.0
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          22L, 
          530579456.0
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          3L, 
          24.0
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          25L, 
          5452595200.0
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          22L, 
          530579456.0
      )))
  
  }
  
  main()
source_py: def sum_subsets_set_formed_first_n_natural_numbers(n):
      return (((n * (n + 1)) / 2) * (1 << (n - 1)))
source_cpp: unsigned long long sum_subsets_set_formed_first_n_natural_numbers(int n) {
    return ( n * ( n + 1 ) / 2 ) * ( 1 << ( n - 1 ) );
  }