Predicting \(2^n\) (in base 10)

Abstract

Abstract

I work towards a formula to predict \(2^n\) for any \(n\). I don’t expect to complete it, but I have found the last four digits for any \(n \in \mathbb{N}\).

Update: I have found a relationship between the sequences that in theory should allow the calculation of any digit of \(2^n\) by storing only \(4\) digits...

Update II: The sequence fails for some numbers as it cycles in a non prime manner, numbers would either need to be stored, or a prime cycling sequence discovered which seems unlikely.

Statement of Problem

I would like to be able to predict any given digit of then number \(2^n\) for any \(n\). The sequence begins \[2,4,8,16,32,64,128,256,512,...\]

We can see the end digit here will always be predictable by a sequence of period \(4\), which is \(2,4,8,6...\). This is nice and simple.

Assuming, there exists such a sequence for any given digit, we may attempt to find them and thier relationships with each other and the original sequence, apart from the obvious \(2^n \; \mathrm{mod} \; 10^k\), for the \(k^{th}\) digit.

Finding the Sequences

So categorising the sequences \(D_k\) for the \(k^{th}\)-least significant digit, we have \[D_0 = 2,4,8,6... \;\; p:4 \;\; OEIS:A000689 \\ \\ D_1 = 0|0,0,1,3,6,2,5,1,2,4,9,9,8,6,3,7,4,8,7,5...\;\; p:20 \;\; OEIS:A160590 \\ \\ D_2 = 0,0|0,0,0,0,1,2,5,0,0,0,1,3,7,5,0,1,2,5,1,3,6,2,4,8,7,4,9,8,6,2,5,1,3,7,\\ 4,9,8,7,5,1,2,4,8,6,3,6,3,6,2,4,9,9,9,9,8,7,4,9,9,9,8,6,2,4,9,8,7,4,8,6, \\ 3,7,5,1,2,5,0,1,3,7,4,8,6,2,5,0,1,2,4,8,7,5,1,3,6,3,6,3,7,5... \;\;p:100 \;\; OEIS:-- \\ \\ D_3 = 0,0,0|... \;\; p:500 \;\; OEIS:-- \\ \\\]

Where the \(|\) denotes the starting point of the recuring sequence. We can see that the sequence \(D_k\) is prepended by \(k\) zeroes before the sequence with periodicity \(4\cdot5^k\) occurs.

We may describe the first sequence by: \[P*v[*(((n+3) mod 4)+1)]=D_0 \\ \mathrm{where} \\ Pv=D_0=\begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{bmatrix}\begin{bmatrix} 2\\4\\6\\8 \end{bmatrix}=\begin{bmatrix} 2\\4\\8\\6 \end{bmatrix}\]

Asessing the occurence of each number within \(D_1\), apart from the prepended \(0\), we have each digit \(d\in[0,9]\) occurring exactly twice. Therefore we may express \[0,0,1,3,6,2,5,1,2,4,9,9,8,6,3,7,4,8,7,5... \\ Pv=D_1 \\ \begin{bmatrix} 1&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0\\ 0&0&0&0&0&0&0&0&0&0&1&0&0&0&0&0&0&0&0&0\\ 0&1&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0\\ 0&0&0&1&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0\\ 0&0&0&0&0&0&1&0&0&0&0&0&0&0&0&0&0&0&0&0\\ 0&0&1&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0\\ 0&0&0&0&0&1&0&0&0&0&0&0&0&0&0&0&0&0&0&0\\ 0&0&0&0&0&0&0&0&0&0&0&1&0&0&0&0&0&0&0&0\\ 0&0&0&0&0&0&0&0&0&0&0&0&1&0&0&0&0&0&0&0\\ 0&0&0&0&1&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0\\ 0&0&0&0&0&0&0&0&0&1&0&0&0&0&0&0&0&0&0&0\\ 0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&1\\ 0&0&0&0&0&0&0&0&1&0&0&0&0&0&0&0&0&0&0&0\\ 0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&1&0&0&0\\ 0&0&0&0&0&0&0&0&0&0&0&0&0&1&0&0&0&0&0&0\\ 0&0&0&0&0&0&0&1&0&0&0&0&0&0&0&0&0&0&0&0\\ 0&0&0&0&0&0&0&0&0&0&0&0&0&0&1&0&0&0&0&0\\ 0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&1&0\\ 0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&1&0&0\\ 0&0&0&0&0&0&0&0&0&0&0&0&0&0&0&1&0&0&0&0 \end{bmatrix} \begin{bmatrix} 0\\1\\2\\3\\4\\5\\6\\7\\8\\9\\0\\1\\2\\3\\4\\5\\6\\7\\8\\9 \end{bmatrix}\]

Also anaylysing the sequences take \(D_1\) we have \[0,0,1,3,6,2,5,1,2,4,\;\;\\ 9,9,8,6,3,7,4,8,7,5...\]

Where it can be seen that summing the pairs of numbers downwards makes \(9\) for each pair. We can denote the sequence \(S^{*9*}=9,9,8,6,3,7,4,8,7,5\) the \(9^{th}s\) conjugate of the sequence \(S=0,0,1,3,6,2,5,1,2,4\), such that the sum of the two is \(9,9,9,9,9,9,9,9,9,9\)

In this notation
\(D_0=S_0S_0^{*10*}\), for \(S_0=2,4\).
\(D_1=S_1S_1^{*9*}\), for \(S_1=0,0,1,3,6,2,5,1,2,4\).
\(D_2=S_2S_2^{*9*}\), for \(S_2=0,0,0,0,1,2,5,0,0,0,1,3,7,5,0,1,2,5,1,3,6,2,4,8,7,4,9,8,6,2,5,1,3,7,4,9,8,7,5,1,2,4,8,6,3,6,3,6,2,4\).
Which may ultimately halve the storage space for a ’lookup-method’, for quoting digits of a given \(2^n\). It can be seen that all of the sequences tested end in \(2,4\) and begin with \(2n\) zero terms.