title: Sequences Given Length Every Element Equal Twice Previous
signature: sequencesGivenLengthEveryElementEqualTwicePrevious(m, n) {
test_code: import 'dart:convert';
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  bool validateSolution(int actual, int expected){
      return actual.toString() == expected.toString();
  }
  
  String driver(m, n, int expected){
      try
      {
          if (validateSolution(PLACEHOLDER_FN_NAME(m, n), expected)){
              return "PASSED";
          }
          return "FAILED";
      }catch(exception_object){
          return exception_object.runtimeType.toString();
      }
  }
  
  int main() {
  
      print("TEST-0...${driver(
          38, 34, 
          0)
      }");
  
      print("TEST-1...${driver(
          39, 29, 
          0)
      }");
  
      print("TEST-2...${driver(
          24, 99, 
          0)
      }");
  
      print("TEST-3...${driver(
          90, 23, 
          0)
      }");
  
      print("TEST-4...${driver(
          44, 2, 
          484)
      }");
  
      print("TEST-5...${driver(
          49, 70, 
          0)
      }");
  
      print("TEST-6...${driver(
          58, 84, 
          0)
      }");
  
      print("TEST-7...${driver(
          97, 34, 
          0)
      }");
  
      print("TEST-8...${driver(
          99, 72, 
          0)
      }");
  
      print("TEST-9...${driver(
          19, 67, 
          0)
      }");
  
      return 0;
  }
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 );
  }