OFFSET
1,3
COMMENTS
Given an integer linear equation Sum_{j=1..k} e_j x_j = 0, a(n) is also the modulus of the determinant whose first row is e_1, e_2, ..., e_k and whose other k-1 rows form an integral basis for the integer solution space of the equation. Here n = Product_j p_{e_j}, where p_{e_j} is the e_j-th prime.
For the proof, see Links.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..20000
Christopher J. Smyth, A determinant associated to an integer linear equation
FORMULA
a(n) = (Sum_j e_j^2)/gcd_j(e_j), where n = Product_j p_{e_j}.
EXAMPLE
For n = 63 = 3^2*7 = p_2*p_2*p_4, the corresponding multiset is {2,2,4}, and a(63) = (2^2 + 2^2 + 4^2)/2 = 12. Also the relevant determinant is Det([[2,2,4],[-1,1,0],[-2,0,1]]) = 12.
MAPLE
p:=1: for ind to 1000 do p:=nextprime(p); primeindex[p]:=ind; od:
# so primeindex[p]:=k if p is the k-th prime
out:=[0]: for n from 2 to 100 do f:=ifactors(n)[2];
m:=[]; g:=0; for k to nops(f) do pow:=f[k]; ind:=primeindex[pow[1]]; g:=gcd(g, ind); for e to pow[2] do
m:=[op(m), ind]; od; od; out:=[op(out), sum(m[jj]^2, jj=1..nops(m))/g];
od:print(out);
# second Maple program:
with(numtheory):
a:= n-> (l-> add(i[1]^2*i[2], i=l)/`if`(n=1, 1, igcd(seq(i[1],
i=l))))(map(i-> [pi(i[1]), i[2]], ifactors(n)[2])):
seq(a(n), n=1..80); # Alois P. Heinz, Aug 05 2017
MATHEMATICA
a[n_] := Module[{m}, m = Table[{p, e} = pe; Table[PrimePi[p], {e}], {pe, FactorInteger[n]}] // Flatten; (m.m)/GCD @@ m]; a[1] = 0; Array[a, 80] (* Jean-François Alcover, May 05 2019 *)
PROG
(PARI) a(n) = if (n==1, 0, my(f=factor(n)); sum(k=1, #f~, f[k, 2]*primepi(f[k, 1])^2) /gcd(apply(x->primepi(x), f[, 1]))); \\ Michel Marcus, Jul 19 2017
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Christopher J. Smyth, Jul 07 2017
STATUS
approved