title: Sequences Given Length Every Element Equal Twice Previous
signature: sequencesGivenLengthEveryElementEqualTwicePrevious :: Integer -> Integer -> Integer
  sequencesGivenLengthEveryElementEqualTwicePrevious m n = 
test_code: import Text.Printf
  import Control.Exception (catch, SomeException)
  import Data.Typeable
  import qualified Data.List as List
  import qualified Data.Map as Map
  import qualified Data.Set as Set
  
  -- SOLUTION CODE
  -- ============================================
  
  PLACEHOLDER_CODE_BODY
  
  -- TESTING CODE 
  -- ============================================
  validateSolution :: Integer -> Integer -> Bool
  validateSolution actual expected = do
      actual == expected
  
  
  driver :: Integer -> Integer -> Integer -> String
  driver m n expected = do
      if (validateSolution (PLACEHOLDER_FN_NAME m n) expected)
          then "PASSED"
      else "FAILED"
  
  main = do
      printf "TEST-0...%s\n" (driver (38) (34) (0) )
  
      printf "TEST-1...%s\n" (driver (39) (29) (0) )
  
      printf "TEST-2...%s\n" (driver (24) (99) (0) )
  
      printf "TEST-3...%s\n" (driver (90) (23) (0) )
  
      printf "TEST-4...%s\n" (driver (44) (2) (484) )
  
      printf "TEST-5...%s\n" (driver (49) (70) (0) )
  
      printf "TEST-6...%s\n" (driver (58) (84) (0) )
  
      printf "TEST-7...%s\n" (driver (97) (34) (0) )
  
      printf "TEST-8...%s\n" (driver (99) (72) (0) )
  
      printf "TEST-9...%s\n" (driver (19) (67) (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 );
  }