title: Sequences Given Length Every Element Equal Twice Previous
signature: function sequencesGivenLengthEveryElementEqualTwicePrevious(m, 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 convertToString(actual)===convertToString(expected);
  }
  
  function driver(m, n, expected){
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(m, n),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(38, 34, 0);
    console.log(`TEST-0...${result}`);
  
    result = driver(39, 29, 0);
    console.log(`TEST-1...${result}`);
  
    result = driver(24, 99, 0);
    console.log(`TEST-2...${result}`);
  
    result = driver(90, 23, 0);
    console.log(`TEST-3...${result}`);
  
    result = driver(44, 2, 484);
    console.log(`TEST-4...${result}`);
  
    result = driver(49, 70, 0);
    console.log(`TEST-5...${result}`);
  
    result = driver(58, 84, 0);
    console.log(`TEST-6...${result}`);
  
    result = driver(97, 34, 0);
    console.log(`TEST-7...${result}`);
  
    result = driver(99, 72, 0);
    console.log(`TEST-8...${result}`);
  
    result = driver(19, 67, 0);
    console.log(`TEST-9...${result}`);
  
    process.exit(0);
  };
  
  if (require.main === module) {
    main();
  }
source_py: def sequences_given_length_every_element_equal_twice_previous(m, n):
      if (m < n):
          return 0
      if (n == 0):
          return 1
      res = (sequences_given_length_every_element_equal_twice_previous((m - 1), n) + sequences_given_length_every_element_equal_twice_previous((m // 2), (n - 1)))
      return res
source_cpp: int sequences_given_length_every_element_equal_twice_previous(int m, int n) {
    if ( m < n ) return 0;
    if ( n == 0 ) return 1;
    return sequences_given_length_every_element_equal_twice_previous ( m - 1, n ) + sequences_given_length_every_element_equal_twice_previous ( m / 2, n - 1 );
  }