human
Sequences of given length where every element is more than or equal to twice of previous | Recursive function to find the number of special sequences.
A special sequence cannot exist if length n is more than the maximum value m ..
If n is 0 , found an empty special sequence.
There can be two possibilities : ( 1 ) Reduce last element value ( 2 ) Consider last element as m and reduce number of terms.
Driver Code"
Solution in Python:
 Give me a code to sequences of given length where every element is more than or equal to twice of previous and the other steps required?
assistant
#Here is code to sequences of given length where every element is more than or equal to twice of previous and the other steps required.
 def getTotalNumberOfSequences ( m , n ) :
	if m < n :
		return 0
	if n == 0 :
		return 1
	res = ( getTotalNumberOfSequences ( m - 1 , n ) + getTotalNumberOfSequences ( m // 2 , n - 1 ) )
	return res
if __name__ == ' _ _ main _ _ ' :
	m = 10
	n = 4
	print ( ' Total ▁ number ▁ of ▁ possible ▁ sequences : ' , getTotalNumberOfSequences ( m , n ) )