In how many ways the ball will come back to the first boy after N turns | Function to return the number of sequences that get back to Bob ; Driver code
def numSeq ( n ) : NEW_LINE INDENT return ( pow ( 3 , n ) + 3 * pow ( - 1 , n ) ) // 4 NEW_LINE DEDENT N = 10 NEW_LINE print ( numSeq ( N ) ) NEW_LINE