human
Number of digits in the nth number made of given four digits | Efficient function to calculate number of digits in the nth number constructed by using 6 , 1 , 4 and 9 as digits in the ascending order ..
Number of digits increase after every i - th number where i increases in powers of 4..
Driver Code"
Solution in Python:
 Give me a code to number of digits in the nth number made of given four digits and the other steps required?
assistant
#Here is code to number of digits in the nth number made of given four digits and the other steps required.
 def number_of_digits ( n ) :
	i = 4
	res = 1
	sum = 0
	while ( True ) :
		i *= 4
		res += 1
		sum += i
		if ( sum >= n ) :
			break
	return res
n = 21
print ( number_of_digits ( n ) )