Can't store too lengthy int type
<p>Consider the problem:</p>

<pre><code>It can be shown that for some powers of two in decimal format like:
2^9 = 512
2^89 = 618,970,019,642,690,137,449,562,112
</code></pre>

<p>The results end in a string consisting of 1s and 2s. In fact, it can be proven that for every integer R, there
exists a power of 2 such that 2K where K > 0 has a string of only 1s and 2s in its last R digits.</p>

<p>It can be shown clearly in the table below:</p>

<pre><code>R Smallest K 2^K
1 1 2
2 9 512
3 89 ...112
4 89 ...2112
</code></pre>

<p>Using this technique, what then is the sum of all the smallest K values for 1 &lt;= R &lt;= 10? 
    Proposed sol:
    Now this problem ain't that difficult to solve. You can simply do
    int temp = power(2, int)
and then if you can get the length of the temp then multiply it with</p>

<pre><code>(100^len)-i or (10^len)-i 
</code></pre>

<p>// where i would determine how many last digits you want.</p>

<p>Now this <strong>temp = power(2,int) gets much higher with increasing int that you can't even store it in the int type or even in long int</strong>....
So what would be done. And is there any other solution based on bit strings. I guess that might make this problem easy.
Thanks in advance.</p>
