human
Count set bits in Bitwise XOR of all adjacent elements upto N | Function to count of set bits in Bitwise XOR of adjacent elements up to N.
Stores count of set bits by Bitwise XOR on adjacent elements of [ 0 , N ].
Stores all possible values on right most set bit over [ 0 , N ].
Iterate over the range [ 0 , N ].
Update N.
Update bit_Position.
Driver Code"
Solution in Python:

Give me a code to count set bits in Bitwise XOR of all adjacent elements upto N and the other steps required?
assistant
#Here is code to count set bits in Bitwise XOR of all adjacent elements upto N and the other steps required.
 def countXORSetBitsAdjElemRange1_N ( N ) :
	total_set_bits = 0
	bit_Position = 1
	while ( N ) :
		total_set_bits += ( ( N + 1 ) // 2 * bit_Position )
		N -= ( N + 1 ) // 2
		bit_Position += 1
	return total_set_bits
if __name__ == ' _ _ main _ _ ' :
	N = 4
	print ( countXORSetBitsAdjElemRange1_N ( N ) )