Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
<div class="_1l1MA">The number of lucky numbers with <strong>exactly</strong> <code>n</code> digits is equal to <code>2<sup>n</sup></code>.</div>
<div class="_1l1MA">We can obtain how many digits the <code>k<sup>th</sup></code> lucky number has.</div>
<div class="_1l1MA">Imagine we know that <code>k<sup>th</sup></code> lucky number has <code>c</code> digits. Then calculate how many numbers with <code>c</code> digits exist before the <code>k<sup>th</sup></code> lucky number.</div>
<div class="_1l1MA">Imagine the number from the previous hint is <code>x</code>. Now look at the binary representation of <code>x</code> and add some leading zero to make its length equal to <code>c</code>.</div>
<div class="_1l1MA">Replace <code>0</code> and <code>1</code> with <code>4</code> and <code>7</code> in the number you've obtained from the previous hint.</div>