human
Program to find first N Fermat Numbers | Iterative Function to calculate ( x ^ y ) in O ( log y ).
res = 1 Initialize result.
If y is odd , multiply x with the result.
n must be even now y = y >> 1 y = y / 2 x = x * x Change x to x ^ 2.
Function to find nth fermat number.
2 to the power i.
2 to the power 2 ^ i.
Function to find first n Fermat numbers.
Calculate 2 ^ 2 ^ i.
Driver code.
Function call"
Solution in Python:

Write me a code to program to find first N Fermat Numbers and the other steps required?
assistant
#Here is code to program to find first N Fermat Numbers and the other steps required.
 def power ( x , y ) :
	while ( y > 0 ) :
		if ( y & 1 ) :
			res = res * x
	return res
def Fermat ( i ) :
	power2_i = power ( 2 , i )
	power2_2_i = power ( 2 , power2_i )
	return power2_2_i + 1
def Fermat_Number ( n ) :
	for i in range ( n ) :
		print ( Fermat ( i ) , end = " " )
		if ( i != n - 1 ) :
			print ( end = " , ▁ " )
n = 7
Fermat_Number ( n )