title: Sum Subsets Set Formed First N Natural Numbers
signature: function sumSubsetsSetFormedFirstNNaturalNumbers(n) {
test_code: 
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function convertToString(value) {
      return JSON.stringify(value, function (key, val) {
          if (val instanceof Set) {
              return Array.from(val);
          } return val;});
  }
  
  function validateSolution(actual, expected){
      return Math.abs(actual - expected) < 1e-09;
  }
  
  function driver(n, expected){
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(26, 11777605632.0);
    console.log(`TEST-0...${result}`);
  
    result = driver(35, 10823317585920.0);
    console.log(`TEST-1...${result}`);
  
    result = driver(34, 5111011082240.0);
    console.log(`TEST-2...${result}`);
  
    result = driver(22, 530579456.0);
    console.log(`TEST-3...${result}`);
  
    result = driver(3, 24.0);
    console.log(`TEST-4...${result}`);
  
    result = driver(25, 5452595200.0);
    console.log(`TEST-5...${result}`);
  
    result = driver(22, 530579456.0);
    console.log(`TEST-6...${result}`);
  
    process.exit(0);
  };
  
  if (require.main === module) {
    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 ) );
  }