title: Sequences Given Length Every Element Equal Twice Previous
signature: function sequences_given_length_every_element_equal_twice_previous(m, n)
test_code: using Printf
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  function validate_solution(actual, expected)
      return actual == expected
  end
  
  function driver(m, n, expected)
      try
  
          if validate_solution(PLACEHOLDER_FN_NAME(m, n), expected)
              return "PASSED";
          end
          return "FAILED";
      catch exception_obj
          return string(Base.typename(typeof(exception_obj)).wrapper);
      end
  end
  
  function main()
      
      result = driver(38, 34, 0);
      @printf("TEST-0...%s\n",result);
      
      result = driver(39, 29, 0);
      @printf("TEST-1...%s\n",result);
      
      result = driver(24, 99, 0);
      @printf("TEST-2...%s\n",result);
      
      result = driver(90, 23, 0);
      @printf("TEST-3...%s\n",result);
      
      result = driver(44, 2, 484);
      @printf("TEST-4...%s\n",result);
      
      result = driver(49, 70, 0);
      @printf("TEST-5...%s\n",result);
      
      result = driver(58, 84, 0);
      @printf("TEST-6...%s\n",result);
      
      result = driver(97, 34, 0);
      @printf("TEST-7...%s\n",result);
      
      result = driver(99, 72, 0);
      @printf("TEST-8...%s\n",result);
      
      result = driver(19, 67, 0);
      @printf("TEST-9...%s\n",result);
      
  end
  
  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 );
  }