OFFSET
1,3
COMMENTS
When gcd_j(s_j) = 1, a(n) is the modulus of the determinant whose first row consists of the s_j, and whose remaining rows form a lattice basis for the space of integer solutions of Sum_j s_jx_j = 0. See A289507.
Compare A056239, where the same encoding for integer multisets ('Heinz encoding') is used, but where A056239(n) is the sum, rather than the sum of squares, of the elements of the corresponding multiset (partition).
See also A003963, for which A003963(n) is the product of the elements of the corresponding multiset.
See also A289507, where terms are (Sum_j s_j^2)/gcd_j(s_j) rather than Sum_j s_j^2 (this sequence).
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..20000
FORMULA
For n = Product_k p_k^{r_k}, a(n) = Sum_k k^2 * r_k.
Also a(n) = Sum_j s_j^2, where the multiset of s_j's is the multiset of k's, each with multiplicity r_k.
EXAMPLE
For n = 12 = 2^2 * 3 = p_1 * p_1 * p_2, the multiset is {1,1,2} and so a(12) = 1^2 + 1^2 + 2^2 = 6.
Also a(1) = 0 as n = 1 indexes the empty multiset.
Further a(p_k) = k^2 and a(2^r) = r.
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:=[]; for k to nops(f) do pow:=f[k]; ind:=primeindex[pow[1]]; for e to pow[2] do
m:=[op(m), ind]; od; od; out:=[op(out), sum(m[jj]^2, jj=1..nops(m))];
od:print(out);
# second Maple program:
a:= n-> add(numtheory[pi](i[1])^2*i[2], i=ifactors(n)[2]):
seq(a(n), n=1..80); # Alois P. Heinz, Aug 05 2017
MATHEMATICA
Table[Total[FactorInteger[n] /. {p_, e_} /; p > 0 :> e PrimePi[p]^2], {n, 64}] (* Michael De Vlieger, Jul 12 2017 *)
PROG
(PARI) a(n) = my(f=factor(n)); sum(k=1, #f~, primepi(f[k, 1])^2*f[k, 2]); \\ Michel Marcus, Jul 19 2017
CROSSREFS
KEYWORD
AUTHOR
Christopher J. Smyth, Jul 07 2017
STATUS
approved