human
Number of sequences which has HEAD at alternate positions to the right of the first HEAD | function to calculate total sequences possible.
Value of N is even.
Value of N is odd.
Driver code"
How can the above be solved in Python?
 ... Write me a code to number of sequences which has HEAD at alternate positions to the right of the first HEAD and the other steps required?
assistant
#Here is code to number of sequences which has HEAD at alternate positions to the right of the first HEAD and the other steps required.
 def findAllSequence ( N ) :
	if ( N % 2 == 0 ) :
		return ( pow ( 2 , N / 2 + 1 ) + pow ( 2 , N / 2 ) - 2 ) ;
	else :
		return ( pow ( 2 , ( N + 1 ) / 2 ) + pow ( 2 , ( N + 1 ) / 2 ) - 2 ) ;
N = 2 ;
print ( int ( findAllSequence ( N ) ) ) ;