human
Count numbers from a given range having same first and last digits in their binary representation | Function to count numbers in range [ L , R ] having same first and last digit in the binary representation.
Given range [ L , R ].
Function Call"
Solution in Python:
assistant
#Here is code to count numbers from a given range having same first and last digits in their binary representation and the other steps required.
 def Count_numbers ( L , R ) :
	count = ( R - L ) // 2
	if ( R % 2 != 0 or L % 2 != 0 ) :
		count += 1
	print ( count )
L = 6
R = 30
Count_numbers ( L , R )