As requested I'm posting this an answer. I wrote a short sage script to check the primality of numbers of the form $10^n+333$ where $n$ is in the range $[4,2000]$. I found that the following values of $n$ give rise to prime numbers:
$$4,5,6,12,53,222,231,416.$$
Edit 3: I stopped my laptop's search between 2000 and 3000, since it hadn't found anything in 20 minutes. I wrote a quick program to check numbers of the form $10^n+3*10^i+33$. Here are a couple
- 100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000033
- 100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000300033
- 100000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000033
- 100000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000033
- 100000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000033
- 10000000000000000000000000000000003000000033
- 10000000000000000000000000000030000000000033
- 10000000000000000000000030000000000000000033
- 10000000003000000000000000000000000000000033
There seemed to be plenty of numbers of this form and presumably I could find more if I checked some of the other possible forms as outlined by dr jimbob.
Note: I revised the post a bit after jimbob pointed out I was actually looking for primes that didn't quite fit the requirements.
Edit 4: As requested here are the sage scripts I used.
To check if $10^n+333$ was prime:
for n in range(0,500):
k=10^n+333
if(is_prime(k)):
print n
And to check for numbers of the form $10^n+3*10^i+33$:
for n in range(0,500):
k=10^n+33
for i in range(2,n):
l=k+3*10^i
if(is_prime(l)):
print l
If you already know the number is a power of 2, then all the factors are also powers of 2. So, if $n=2^k$, then the factors are $1, 2, 2^2, \dots 2^k$, and there are exactly $k+1$ of them.
Best Answer
Figured it out! We first need to find the number of digits of $2^n$, which can be done using logarithms: we need to solve (approximately) $2^n = 10^d$. In the end, the formula for the number of digits $d$ is $d = 1+\left\lfloor n\,\log_{10}2\right\rfloor$. Then, once we have $d$, then we see that if we can solve for $10^{d-k} \cdot t < 2^n < 10^{d-k} \cdot (t + 1)$ (where $k$ is the number of leading digits we want), then $t$ is the number we want. In this specific example, we find that the first three digits are $\lfloor 10 ^ {n \log2 - d + 3}\rfloor = 454$, where $n = 123456789$ and $d$ is calculated as above.