I want to get nth digit of the lucky string . Lucky string is made by the concatenation of lucky digits i.e. 4 and 7 in the increasing order . Thus lucky string is 4744477477444.... and so on.
Value of n is of the order 10^15 .
How to solve this type of problem ? Is there any DP solution ?
Example : n=1 ans is 4 . n=10 ans is 4.