# Further Still On Natural Analogarithms

For several months now my fellow students and I have been exploring $$\boldsymbol\ell$$-space, being the set of infinite dimensional vectors whose elements are the powers of the prime factors of the roots of rational numbers, which we chanced upon whilst attempting to define a rational valued logarithmic function for such numbers[1].
We have seen how we might define functions of roots of rationals employing the magnitude of their associated $$\boldsymbol\ell$$-space vectors and that the iterative computation of such functions may yield cyclical sequences, although we conspicuously failed to figure a tidy mathematical rule governing their lengths[2].
The magnitude is not the only operation of linear algebra that we might bring to bear upon such roots, however, and we have lately busied ourselves investigating another.

Let me begin by reminding you that we first defined for a root of a rational
$x = \prod_{p \in P} p^{k_p}$
where $$\prod$$ is the product sign, $$\in$$ means within, $$P$$ is the set of all prime numbers and each $$k_p$$ is itself a rational number, its logarithm with respect to a prime number $$p$$ as
$\mathrm{lf}_p(x) = k_p$
We then defined a set of units $$\ell_p$$ to indicate the primes with respect to which their coefficients are the logarithms so that we could define the logarithm with respect to all primes as
$\mathrm{lp}(x) = \sum_{p \in P} \mathrm{lf}_p(x) \ell_p$
where $$\sum$$ is the summation sign. We were able to invert this logarithm with the exponential function by equating each of those units with the natural logarithm of its prime
$e^{\mathrm{lp}(x)} = e^{\sum_{p \in P} \mathrm{lf}_p(x) \ell_p} = e^{\sum_{p \in P} \mathrm{lf}_p(x) \times \ln p} = \prod_{p \in P} e^{\mathrm{lf}_p(x) \times \ln p} = \prod_{p \in P} \left(e^{\ln p}\right)^{\mathrm{lf}_p(x)} = \prod_{p \in P} p^{\mathrm{lf}_p(x)} = \prod_{p \in P} p^{k_p} = x$
Finally, we defined a vector whose elements were those units
$\boldsymbol{\ell} = \begin{pmatrix} \ell_2\\ \ell_3\\ \ell_5\\ \vdots \end{pmatrix}$
and the transformation of a root of a rational into an $$\boldsymbol\ell$$-space vector as
$\tfrac{\mathrm{lp}}{\boldsymbol\ell}(x) = \begin{pmatrix} \mathrm{lf}_2(x)\\ \mathrm{lf}_3(x)\\ \mathrm{lf}_5(x)\\ \vdots \end{pmatrix}$
so named because
$\tfrac{\mathrm{lp}}{\boldsymbol\ell}(x) \times \boldsymbol\ell = \begin{pmatrix} \mathrm{lf}_2(x)\\ \mathrm{lf}_3(x)\\ \mathrm{lf}_5(x)\\ \vdots \end{pmatrix} \times \begin{pmatrix} \ell_2\\ \ell_3\\ \ell_5\\ \vdots \end{pmatrix} = \sum_{p \in P} \mathrm{lf}_p(x) \ell_p = \mathrm{lp}(x)$
Listing 1 gives our implementation of the logarithm lp, having an ak.rational argument x, a positive integer argument r indicating the root of it, defaulting to no root, and returning an array of objects representing the unit $$\ell_p$$ with a property p and its coefficient with a property k.

Listing 1: The Rational Root Logarithm
function lp(x, r) {
var i = 0;
var l = [];
var n, d, p, k;

if(ak.type(x)!==ak.RATIONAL_T) {
throw new Error('invalid argument in lp');
}
n = x.num();
d = x.den();
if(n<=0 || !isFinite(n)) throw new Error('invalid argument in lp');

if(ak.nativeType(r)===ak.UNDEFINED_T) {
r = 1;
}
else if(r!==ak.floor(r) || r<1 || !isFinite(r)) {
throw new Error('invalid root in lp');
}

while(n>1 || d>1) {
p = ak.primeSequence(i++);
k = 0;
if(n>1) while(n%p===0) {++k; n /= p;}
if(d>1) while(d%p===0) {--k; d /= p;}
if(k!==0) l.push({p: p, k: ak.rational(k, r)});
}
return l;
}


### The $$\boldsymbol\ell$$-Space Inner Product

It takes no great leap of imagination to define a binary operator for roots of rational numbers as the inner product of their associated $$\boldsymbol\ell$$-space vectors
$x \circ y = \tfrac{\mathrm{lp}}{\boldsymbol\ell}(x) \times \tfrac{\mathrm{lp}}{\boldsymbol\ell}(y) = \begin{pmatrix} \mathrm{lf}_2(x)\\ \mathrm{lf}_3(x)\\ \mathrm{lf}_5(x)\\ \vdots \end{pmatrix} \times \begin{pmatrix} \mathrm{lf}_2(y)\\ \mathrm{lf}_3(y)\\ \mathrm{lf}_5(y)\\ \vdots \end{pmatrix} = \sum_{p \in P} \mathrm{lf}_p(x) \times \mathrm{lf}_p(y)$
Now it is trivially the case that this must yield a rational number, albeit possibly a negative one. Furthermore, if both $$x$$ and $$y$$ are positive rationals then it must yield an integer, once again admitting the possibility of a negative result. Finally, if they are both positive integers then the result must be a non-negative integer.

By way of an example we should have
$1500 \circ 1350 = \left(2^2 \times 3^1 \times 5^3\right) \circ \left(2^1 \times 3^3 \times 5^2\right) = \begin{pmatrix} 2\\ 1\\ 3\\ 0\\ \vdots \end{pmatrix} \times \begin{pmatrix} 1\\ 3\\ 2\\ 0\\ \vdots \end{pmatrix} = 2 \times 1 + 1 \times 3 + 3 \times 2 = 11$
My fellow students and I have put together deck 1 to figure the result of this operator for randomly chosen integer arguments between two and five hundred.

Deck 1: For Random Arguments

You will no doubt notice, as did we, that it is frequently equal to zero and so we built deck 2 to plot the logarithms of its results for many values of $$x$$ and $$y$$, with brighter points indicating greater results.

Deck 2: For Many Arguments

The grid-like structure arises as a consequence of the fact that repeated powers of small primes occur much more frequently than those of large primes. In particular, we should expect the greatest results for pairs of numbers having large powers of two in their factorisations and this alone accounts for most of the structure in the graph.

Now a basic property of the inner product is that we can use it to figure the angle between two vectors with
$\cos\left(\mathbf{x} \measuredangle \mathbf{y}\right) = \frac{\mathbf{x} \times \mathbf{y}}{|\mathbf{x}| \times |\mathbf{y}|}$
where the vertical bars stand for the length of the vector that they enclose. We might therefore measure the $$\boldsymbol\ell$$-space angle between two roots of rationals as
$\cos\left(x \measuredangle_{\boldsymbol\ell} y\right) = \frac{x \circ y}{|x|_{\boldsymbol\ell} \times |y|_{\boldsymbol\ell}}$
where
$|x|_{\boldsymbol\ell} = \sqrt{\sum_{p \in P}\mathrm{lf}_p(x)^2}$
is the $$\boldsymbol\ell$$-space magnitude. Noting that
$\mathrm{lf}_p\left(x^k\right) = k \times \mathrm{lf}_p\left(x\right)$
for rational $$k$$, we have
\begin{align*} \cos\left(x \measuredangle_{\boldsymbol\ell} x^k\right) &= \frac{x \circ x^k}{|x|_{\boldsymbol\ell} \times \left|x^k\right|_{\boldsymbol\ell}} = \frac{\sum_{p \in P} \mathrm{lf}_p(x) \times \mathrm{lf}_p\left(x^k\right)}{\sqrt{\sum_{p \in P}\mathrm{lf}_p(x)^2} \times \sqrt{\sum_{p \in P}\mathrm{lf}_p\left(x^k\right)^2}}\\ &= \frac{\sum_{p \in P} \mathrm{lf}_p(x) \times k \times \mathrm{lf}_p(x)}{\sqrt{\sum_{p \in P}\mathrm{lf}_p(x)^2} \times \sqrt{\sum_{p \in P}k^2 \times \mathrm{lf}_p(x)^2}} = \frac{k \times \sum_{p \in P} \mathrm{lf}_p(x)^2}{|k| \times \sum_{p \in P} \mathrm{lf}_p(x)^2} = \mathrm{sign}(k) \end{align*}
being equal to plus one for positive $$k$$ and minus one for negative $$k$$.

### $$\boldsymbol\ell$$-Space Similarity

We may consequently use this cosine as a similarity measure for roots of rationals, with all positive rational powers of any given example being classed as a family that is closed under multiplication, in the sense that the product of any two of its members is also a member, since
$x^{\tfrac{a_1}{b_1}} \times x^{\tfrac{a_2}{b_2}} = x^{\tfrac{a_1}{b_1}+\tfrac{a_2}{b_2}} = x^{\tfrac{a_1 \times b_2 + a_2 \times b_1}{b_1 \times b_2}}$
Contrarily, their reciprocals are its antithesis, being the family of numbers that are most dissimilar to it and its kin.
Deck 3 plots these similarities for numbers greater than zero in steps of one thirtieth ranging from red at minus one through black at zero to green at plus one.

Deck 3: ℓ-Space Similarities

Figure 1: Maxima Of The Sequences
My fellow students and I could not help but be struck by the similarities between this graph and that of the maxima of sequences taking the form
\begin{align*} x_0 &= c\\ x_i &= c \times \left|x_{i-1}\right|_{\boldsymbol\ell} \end{align*}
that we studied last time, where
$\left|x\right|_{\boldsymbol\ell} = \left|\tfrac{\mathrm{lp}}{\boldsymbol\ell}(x)\right| = \sqrt{\sum_{p \in P} \mathrm{lf}_p(x)^2}$
is the $$\boldsymbol\ell$$-space magnitude, plotted on a logarithmic scale for
$c = \frac{x}{y}$
in figure 1; most particularly by its grid-like structure overlain with radial spokes.

As before, these radial spokes occur for values of $$x$$ and $$y$$ whose ratios are small integers or the reciprocals of small integers and such values have prime factorisations that differ by relatively few primes. For example, consider $$y$$ equal to twice $$x$$ having the factorisations
\begin{align*} x &= 2^{k_2} \times \prod_{p \in P-\{2\}} p^{k_p}\\ 2x &= 2^{k_2+1} \times \prod_{p \in P-\{2\}} p^{k_p} \end{align*}
where $$S_1-S_2$$ is the set of every element contained within $$S_1$$ except those that are also members of $$S_2$$. These values consequently have squared $$\boldsymbol\ell$$-space magnitudes of
\begin{align*} |x|_{\boldsymbol\ell}^2 &= k_2^2 + \sum_{p \in P-\{2\}} k_p^2\\ |2x|_{\boldsymbol\ell}^2 &= \left(k_2+1\right)^2 + \sum_{p \in P-\{2\}} k_p^2 = k_2^2 + 2k_2 + 1 + \sum_{p \in P-\{2\}} k_p^2 = |x|_{\boldsymbol\ell}^2 + 2k_2 + 1 \end{align*}
Furthermore, the result of our operator is
$x \circ 2x = k_2 \times \left(k_2 + 1\right) + \sum_{p \in P-\{2\}} k_p^2 = k_2^2 + k_2 + \sum_{p \in P-\{2\}} k_p^2 = |x|_{\boldsymbol\ell}^2 + k_2$
from which we may figure the similarity between $$x$$ and $$2x$$ to be
$\cos\left(x \measuredangle_{\boldsymbol\ell} 2x\right) = \frac{|x|_{\boldsymbol\ell}^2 + k_2}{|x|_{\boldsymbol\ell} \times \sqrt{|x|_{\boldsymbol\ell}^2 + 2k_2 + 1}} = \frac{1 + \tfrac{k_2}{|x|_{\boldsymbol\ell}^2}}{\sqrt{1 + \tfrac{2k_2 + 1}{|x|_{\boldsymbol\ell}^2}}}$
Finally, if $$k_2$$ is small when compared to $$|x|_{\boldsymbol\ell}^2$$, as it should be for most $$x$$, then this result will be close to one.

The grid of red dots occur for values of $$x$$ and $$y$$ that have a sufficient number of the prime factors from our denominator of thirty, namely two, three and five, within their numerators. For example, consider similarities between
\begin{align*} x &= 4\\ y &= \frac{n}{30} \end{align*}
for a few positive integer $$n$$
\begin{align*} n&=1 & \cos\left(2^2 \;\;\measuredangle_{\boldsymbol\ell}\;\; 2^{-1} \times 3^{-1} \times 5^{-1}\right) &= \frac{2 \times -1 + 0 \times -1 + 0 \times -1}{\sqrt{2^2} \times \sqrt{(-1)^2 + (-1)^2 + (-1)^2}} = -\frac{1}{\sqrt{3}}\\ n&=2 & \cos\left(2^2 \;\;\measuredangle_{\boldsymbol\ell}\;\; 2^{0\phantom{-}} \times 3^{-1} \times 5^{-1}\right) &= \frac{2 \times 0\phantom{-} + 0 \times -1 + 0 \times -1}{\sqrt{2^2} \times \sqrt{0^2\phantom{(-)} + (-1)^2 + (-1)^2}} = \phantom{-}\;\;0\\ n&=3 & \cos\left(2^2 \;\;\measuredangle_{\boldsymbol\ell}\;\; 2^{-1} \times 3^{0\phantom{-}} \times 5^{-1}\right) &= \frac{2 \times -1 + 0 \times 0\phantom{-} + 0 \times -1}{\sqrt{2^2} \times \sqrt{(-1)^2 + 0^2\phantom{(-)} + (-1)^2}} = -\frac{1}{\sqrt{2}}\\ n&=4 & \cos\left(2^2 \;\;\measuredangle_{\boldsymbol\ell}\;\; 2^{1\phantom{-}} \times 3^{-1} \times 5^{-1}\right) &= \frac{2 \times 1 + 0 \times -1 + 0 \times -1}{\sqrt{2^2} \times \sqrt{1^2\phantom{(-)} + (-1)^2 + (-1)^2}} = \phantom{-}\frac{1}{\sqrt{3}}\\ n&=5 & \cos\left(2^2 \;\;\measuredangle_{\boldsymbol\ell}\;\; 2^{-1} \times 3^{-1} \times 5^{0\phantom{-}}\right) &= \frac{2 \times -1 + 0 \times -1 + 0 \times 0\phantom{-}}{\sqrt{2^2} \times \sqrt{(-1)^2 + (-1)^2 + 0^2\phantom{(-)}}} = -\frac{1}{\sqrt{2}}\\ n&=6 & \cos\left(2^2 \;\;\measuredangle_{\boldsymbol\ell}\;\; 2^{0\phantom{-}} \times 3^{0\phantom{-}} \times 5^{-1}\right) &= \frac{2 \times 0\phantom{-} + 0 \times 0\phantom{-} + 0 \times -1}{\sqrt{2^2} \times \sqrt{0^2\phantom{(-)} + 0^2\phantom{(-)} + (-1)^2}} = \phantom{-}\;\;0 \end{align*}
Continuing in this fashion we find that for all odd $$n$$, $$y$$ is dissimilar to four and we should consequently expect to observe a vertical line of red dots upon the graph at $$x$$ equal to four. We should further expect similar results for numbers having positive factors of three and five but not for any other primes and my fellow students and I therefore suspect that those similarities are superficial and do not suggest some deeper relationship between the maxima of iterated $$\boldsymbol\ell$$-space magnitudes and the $$\boldsymbol\ell$$-space similarities between the numerators and denominators of the values for which we figured them.

Now, we have caught glimpse of another feature of $$\boldsymbol\ell$$-space that we should very much like to explore, but we must put such endeavours aside for the time being since our studies presently command our full attention.
$$\Box$$

### References

[1] On Natural Analogarithms, www.thusspakeak.com, 2018.

[2] Further On Natural Analogarithms, www.thusspakeak.com, 2018.