Consider the final k digits of 2^n. (If 2^n has fewer than k digits, pad with zeroes.) Now repeatedly multiply by 2, and then truncate mod 10^k.
For k = 2, you get the repeating sequence "2", "4", "8", "6", "2", ....
For k = 3 you get the repeating sequence "04", "08", "16", "32", "64", "28", "56", "12", "24", "48", "96", "92", "84", "68", "36", "72", "44", "88", "76", "52", "04", ....
2^(n+4) = 2^n mod 10^1
2^(n+20) = 2^n mod 10^2
2^(n+100) = 2^n mod 10^3
2^(n+500) = 2^n mod 10^4
...
Because there are only 10^k possible k-digit strings, we know that ultimately the final k digits of each successive power of 2 must ultimately enter a loop.
In practice, that loop seems to grow in size by a factor of 5 each time. (I assume there is a number theoretic reason for this, but I am not sure because I am terrible at number theory.) So let's assume (possibly fallaciously) that the loop contains 4* 5^(k-1) distinct elements. (Notice how this is substantially less than the 10^k possible elements.)
Assuming that the digits are distributed randomly - which, again, is possibly fallacious - the probability of a random k-digit number containing no zeroes is (9/10)^k.
Therefore, the probability of a k-digit number containing at least one zero is 1-(9/10)^k.
Therefore, the probability of all 4* 5^(k-1) elements containing at least one zero is [1-(9/10)^k]^[4* 5^(k-1)].
Which rapidly tends to 0. Hoom. Well, I hoped to show it tended to 1, but never mind.
> In practice, that loop seems to grow in size by a factor of 5 each time. (I assume there is a number theoretic reason for this, but I am not sure because I am terrible at number theory.)
I can explain this reason. Consider 2^n mod 10^k. If n > k, then we can rewrite this as:
2^k * (2^(n-k) mod 5^k)
And then the Euler-Fermat theorem states that, if a and m are coprime, then
a^(φ(m)) ≣ 1 (mod m)
where φ(m) is Euler's totient function, the number of integers from 1 to m that are coprime to m. And φ(p^k) = (p-1) * p^(k-1) for any prime p, so we get in particular that φ(5^k) = 4 * 5^(k-1), which gives us the (maximum possible value of the) cycle length.
For k = 2, you get the repeating sequence "2", "4", "8", "6", "2", ....
For k = 3 you get the repeating sequence "04", "08", "16", "32", "64", "28", "56", "12", "24", "48", "96", "92", "84", "68", "36", "72", "44", "88", "76", "52", "04", ....
2^(n+4) = 2^n mod 10^1
2^(n+20) = 2^n mod 10^2
2^(n+100) = 2^n mod 10^3
2^(n+500) = 2^n mod 10^4
...
Because there are only 10^k possible k-digit strings, we know that ultimately the final k digits of each successive power of 2 must ultimately enter a loop.
In practice, that loop seems to grow in size by a factor of 5 each time. (I assume there is a number theoretic reason for this, but I am not sure because I am terrible at number theory.) So let's assume (possibly fallaciously) that the loop contains 4* 5^(k-1) distinct elements. (Notice how this is substantially less than the 10^k possible elements.)
Assuming that the digits are distributed randomly - which, again, is possibly fallacious - the probability of a random k-digit number containing no zeroes is (9/10)^k.
Therefore, the probability of a k-digit number containing at least one zero is 1-(9/10)^k.
Therefore, the probability of all 4* 5^(k-1) elements containing at least one zero is [1-(9/10)^k]^[4* 5^(k-1)].
Which rapidly tends to 0. Hoom. Well, I hoped to show it tended to 1, but never mind.