How many digit number I have to write if I write $2^n$ exponential sequence from 1 to $2^{1000}$?

110 Views Asked by At

If I write sequence $2^n$ exponential sequence, "1,2,4,8,16,..." until I reach $2^{1000}$, how many digit number I have to write ?

I try using the method that work for linear sequence by writing some first sequence and find the pattern.

1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536,131072,262144,524288,1048576,2097152,4194304,8388608,16777216,33554432,67108864,134217728,268435456,536870912,1073741824,...

The total digit number seem to be repeat (1+1+1+1)+(2+2+2)+(3+3+3)+(4+4+4+4)+(5+5+5)+(6+6+6)+(7+7+7+7)+(8+8+8)+(9+9+9)+...

The total digit number from I have to write from 1 to 536870912 or $2^{29}$ is 4(1)+3(2)+3(3)+4(4)+3(5)+3(6)+4(7)+3(8)+3(9) = 147.

From this, I get

  • Total digit number from I have to write for number $2^{(10n-10)}$,$2^{(10n-9)}$,$2^{(10n-8)}$,$2^{(10n-7)}$ is $3n-2$ if n>0
  • Total digit number from I have to write for number $2^{(10n-6)}$,$2^{(10n-5)}$,$2^{(10n-4)}$ is $3n-1$ if n>0
  • Total digit number from I have to write for number $2^{(10n-3)}$,$2^{(10n-2)}$,$2^{(10n-1)}$ is $3n$ if n>0
  • Total digit number from I have to write from 1 to $2^{(10n-1)}$ is $\sum_{k=1}^{n} \biggl(4(3k-2)+3(3k-1)+3(3k)\biggl)$ if n>0

So, the total digit number from I have to write from 1 to $2^{1000}$ is $(3(101)-2)+\sum_{k=0}^{100} \biggl(4(3k-2)+3(3k-1)+3(3k)\biggl) = 301+150400 = 150701$.

Am I get the correct answer ? I am not sure since it is a method for linear sequence not exponential sequence.

If my answer isn't correct answer, what is the correct answer ?

2

There are 2 best solutions below

7
On BEST ANSWER

Addendum added to give an exact answer.


Let $\displaystyle M = \log_{10} (2) \approx 0.301029995.$
This implies that for any non-negative integer $k$,
$\displaystyle \log_{10}\left(2^k\right) = kM.$

For any Real number $(r)$, let $~\lfloor r\rfloor~$ (i.e. the floor function)
denote the largest integer $~\leq r.$

Any positive integer $(n)$ that does not have form $~\displaystyle (10)^k ~: ~k \in \Bbb{Z^+}, ~$ will require
$\displaystyle \lfloor 1 + \log_{10}(n)\rfloor = 1 + \lfloor \log_{10}(n)\rfloor~$ digits to write.

Therefore, for any non-negative integer $(k)$, the number $~\displaystyle \left(2^k\right)~$ will require
$\displaystyle 1 + \lfloor kM\rfloor~$ digits to write.

Therefore, the exact value is

$$1001 + \sum_{k=0}^{1000} \left\lfloor kM\right\rfloor. \tag1 $$

The challenge is to turn the expression in (1) above into an exact value. The OP's (i.e. original poster's) approach was (in effect) to assume that :

  • $\displaystyle 0 \leq k \leq 3 \implies \left\lfloor kM\right\rfloor = 0.$

  • $\displaystyle 4 \leq k \leq 6 \implies \left\lfloor kM\right\rfloor = 1.$

  • $\displaystyle 7 \leq k \leq 9 \implies \left\lfloor kM\right\rfloor = 2.$

  • $\displaystyle 10 \leq k \leq 13 \implies \left\lfloor kM\right\rfloor = 3.$

  • $\displaystyle 14 \leq k \leq 16 \implies \left\lfloor kM\right\rfloor = 4.$

  • $\displaystyle 17 \leq k \leq 19 \implies \left\lfloor kM\right\rfloor = 5.$

  • $\cdots $

  • $\displaystyle 990 \leq k \leq 993 \implies \left\lfloor kM\right\rfloor = 297.$

  • $\displaystyle 994 \leq k \leq 996 \implies \left\lfloor kM\right\rfloor = 298.$

  • $\displaystyle 997 \leq k \leq 999 \implies \left\lfloor kM\right\rfloor = 299.$

  • $\displaystyle k = 1000 \implies \left\lfloor kM\right\rfloor = 300.$

This is close but immediately seen to be wrong, given the approximation for $M$.

For example:

  • $\displaystyle \left\lfloor 990 \times M\right\rfloor = 298.$

  • $\displaystyle \left\lfloor 1000 \times M\right\rfloor= 301.$

Personally, I know of know way to get an exact value except to have a computer program evaluate the expression in (1) above. Certainly, the approximation for $~\log_{10}(2)~$ given at the start of this answer should result in an exact answer, since the summation is only going up to $(k = 1000).$


Addendum
A computer program evaluated the expression in (1) above to $151167.$

Also, the computer program gives the approximation for $~\log_{10}(2)~$ as $0.3010299956639812$.

The approximation for $\log_{10}(2)$ that I gave at the start of my answer was from my handheld calculator.

0
On

Doing this in Mathematica in the most direct way possible gives $151167$ as the output of

StringLength["" <> ToString /@ (2^Range[0, 1000])]

If we remove the StringLength on the outside, then "" <> ToString /@ (2^Range[0, 1000]) will print out all $151167$ digits: an output that looks like

"12481632641282565121...24386837205668069376"