title: Sequences Given Length Every Element Equal Twice Previous
signature: func sequencesGivenLengthEveryElementEqualTwicePrevious(m int, n int) int {
test_code: package main
  
  import (
      "fmt"
      "reflect"
      "math"
      "sort"
  )
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  func validateSolution(actual int, expected int) bool {
      return reflect.DeepEqual(actual,expected)
  }
  
  func driver(m int, n int, expected int) string {
      if validateSolution(PLACEHOLDER_FN_NAME(m, n),expected) {
              return "PASSED"
      }
      return "FAILED"
  
  }
  
  func main() {
  
      // Use imports to avoid undefined errors
      var _ = reflect.DeepEqual
      _ = math.Abs
      _ = sort.Sort
      result := ""
      result = driver(38, 
  	34, 0)
      fmt.Printf("TEST-0...%s\n", result)
      
      result = driver(39, 
  	29, 0)
      fmt.Printf("TEST-1...%s\n", result)
      
      result = driver(24, 
  	99, 0)
      fmt.Printf("TEST-2...%s\n", result)
      
      result = driver(90, 
  	23, 0)
      fmt.Printf("TEST-3...%s\n", result)
      
      result = driver(44, 
  	2, 484)
      fmt.Printf("TEST-4...%s\n", result)
      
      result = driver(49, 
  	70, 0)
      fmt.Printf("TEST-5...%s\n", result)
      
      result = driver(58, 
  	84, 0)
      fmt.Printf("TEST-6...%s\n", result)
      
      result = driver(97, 
  	34, 0)
      fmt.Printf("TEST-7...%s\n", result)
      
      result = driver(99, 
  	72, 0)
      fmt.Printf("TEST-8...%s\n", result)
      
      result = driver(19, 
  	67, 0)
      fmt.Printf("TEST-9...%s\n", result)
      
          
  }
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 );
  }