Let $Log(n) = \sum_{i=1}^r \alpha_i \cdot e_i$, where $n = \prod_{i=1}^r p_i^{\alpha_i}$ and $p_i$ is the $i$-th prime, $\alpha_i \ge 0$, $e_i$ is the $i$-th standard basis vector. For example $6 = 2\cdot3$, hence: $$Log(6) = (1,1,0,0,0,\cdots)$$ $$Log(15) = (0,1,1,0,0,\cdots)$$ $$Log(7) = (0,0,0,1,0,\cdots)$$ Consider the matrix $A_n = (Log(1)^T,Log(2)^T,\cdots,Log(n)^T)$. Then one can think about that $rank(A_n) = \Pi(n)$, where $\Pi$ is the prime counting function. For fun, we might compute the Smith normal form of this matrix: $$D_n = U_n A_n V_n$$ I conjecture that $V_n = 1_n$ and that $D_n$ consists of $\Pi(n)$ ones on the diagonal. Now the mysterious part is the irreducible factors of the characteristic polynomial of $U_n$.
Here is a list for $1 \le n \le 20$ computed with SAGEMATH:
1 x - 1
2 x^2 + 1
3 (x - 1) * (x^2 + x + 1)
4 (x - 1)^2 * (x^2 + x + 1)
5 (x - 1) * (x^4 + 1)
6 (x - 1)^2 * (x^4 + 1)
7 (x - 1) * (x^2 + 1) * (x^4 + 1)
8 (x - 1)^2 * (x^2 + 1) * (x^4 + 1)
9 (x - 1)^3 * (x^2 + 1) * (x^4 + 1)
10 (x - 1)^4 * (x^2 + 1) * (x^4 + 1)
11 (x - 1)^5 * (x^2 + 1) * (x^4 + x^3 + x^2 + x + 1)
12 (x - 1)^6 * (x^2 + 1) * (x^4 + x^3 + x^2 + x + 1)
13 (x - 1)^5 * (x^2 + 1)^2 * (x^4 + x^3 + x^2 + x + 1)
14 (x - 1)^6 * (x^2 + 1)^2 * (x^4 + x^3 + x^2 + x + 1)
15 (x - 1)^7 * (x^2 + 1)^2 * (x^4 + x^3 + x^2 + x + 1)
16 (x - 1)^8 * (x^2 + 1)^2 * (x^4 + x^3 + x^2 + x + 1)
17 (x - 1)^9 * (x^2 + 1) * (x^2 + x + 1) * (x^4 + x^3 + x^2 + x + 1)
18 (x - 1)^10 * (x^2 + 1) * (x^2 + x + 1) * (x^4 + x^3 + x^2 + x + 1)
19 (x - 1)^9 * (x^2 + x + 1) * (x^2 + 1)^2 * (x^4 + x^3 + x^2 + x + 1)
20 (x - 1)^10 * (x^2 + x + 1) * (x^2 + 1)^2 * (x^4 + x^3 + x^2 + x + 1)
It occurs that the irreducible factors are cyclotomic polynomials $p(x)$ with $\deg(p(x))=\phi(m)$ for some number $m$. But how does one compute the numbers $m$, given $n$? I think this would give an interesting decomposition of $n$ in summands and products.
For example: $$ 13 = 5\cdot\phi(1)+2\phi(4)+1\phi(5)$$ $$ 5 = 1\cdot\phi(1) + 1\cdot \phi(8)$$
I have tried to search OEIS for various related sequences but without success.
Thanks for you help.
Edit: Here is some sage code, to get the matrix $U_5,\cdots,U_{10}$ and the corresponding matrices.
MAXN=100
def Log(a,N=MAXN):
return vector([valuation(a,p) for p in primes(N)])
def Exp(v,N=MAXN):
P = list(primes(N))
return prod([P[i]**v[i] for i in range(len(P))])
def AA(n,N=MAXN):
return matrix([Log(n,N=N) for n in range(1,n+1)],ring=QQ)
def UU(n,N=MAXN):
D,U,V = (AA(n,N=N)).smith_form()
return U
[ 0 1 0 0 0]
[ 0 0 1 0 0]
[ 0 0 0 0 1]
[ 0 -2 0 1 0]
[-1 0 0 0 0]
[ 0 1 0 0 0 0]
[ 0 0 1 0 0 0]
[ 0 0 0 0 1 0]
[ 0 -2 0 1 0 0]
[-1 0 0 0 0 0]
[ 0 -1 -1 0 0 1]
[ 0 1 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 1]
[-1 0 0 0 0 0 0]
[ 0 -1 -1 0 0 1 0]
[ 0 2 0 -1 0 0 0]
[ 0 1 0 0 0 0 0 0]
[ 0 0 1 0 0 0 0 0]
[ 0 0 0 0 1 0 0 0]
[ 0 0 0 0 0 0 1 0]
[-1 0 0 0 0 0 0 0]
[ 0 -1 -1 0 0 1 0 0]
[ 0 2 0 -1 0 0 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