human
Find i 'th Index character in a binary string obtained after n iterations | Function to store binary Representation.
Function to find ith character.
Function to change decimal to binary.
Assign s1 string in s string.
Driver code"
Solution in Python:
assistant
#Here is code to find i 'th Index character in a binary string obtained after n iterations and the other steps required.
 def binary_conversion ( s , m ) :
	while ( m ) :
		temp = m % 2
		s += str ( temp )
		m = m // 2
	return s [ : : - 1 ]
def find_character ( n , m , i ) :
	s = " "
	s = binary_conversion ( s , m )
	s1 = " "
	for x in range ( n ) :
		for j in range ( len ( s ) ) :
			if s [ j ] == "1" :
				s1 += "10"
			else :
				s1 += "01"
		s = s1
		s1 = " "
	e = ord ( s [ i ] )
	r = ord ( '0' )
	return e - r
m , n , i = 5 , 2 , 8
print ( find_character ( n , m , i ) )