If I took all the numbers from one to one billion:
- How many of them contain at least one '1'?
- If I wrote them out in one long line, how many 1 digits would there be?
Part 1: 612,579,512
Reasoning (In Perl):
my $i=0;
for (1..1000000000)
{
$i++ if (/1/);
}
print $i;
Part 2:
I am just taking a stab at this, and I am not typing the answer here because of accuracy reasons, but I believe it is:
300^1,000,000 + 300^1,000 + 1
The answer is 4955 digits long, but I cant seem to find a calculator to compute that accurately