%I #18 Sep 18 2023 02:02:59
%S 1,1,2,7,4,2,6,13,13,4,10,14,12,6,8,31,16,13,18,28,12,10,22,26,31,12,
%T 38,42,28,8,30,61,20,16,24,91,36,18,24,52,40,12,42,70,52,22,46,62,57,
%U 31,32,84,52,38,40,78,36,28,58,56,60,30,78,127,48,20,66,112,44,24,70,169,72
%N SEPSigma(n) = (-1)^(Sum_i r_i)*Sum_{d|n} (-1)^(Sum_j Max(r_j))*d = Product_i (Sum_{s_i=1..r_i} p_i^s_i)+(-1)^r_i where n = Product_i p_i^r_i, d = Product_j p_j^r_j, p_j^max(r_j) is the largest power of p_j dividing n.
%C SEP stands for Signed by Exponents of Prime factors.
%C By "Max(r_j)" I mean the following: If d|m, d=p^e*q^f, m=p^x*q^y*r^z then Max(e)=x, Max(f)=y.
%H Antti Karttunen, <a href="/A125140/b125140.txt">Table of n, a(n) for n = 1..20000</a>
%F a(n) = Product_i (-1)^r_i + ((p_i^(r_i+1)-p_i)/(p_i-1)), where p_i and r_i range over the primes and their exponents in the prime factorization of n.
%F a(n) = Product_{p^e || n} (-1)^e + ((p^(1+e)-p)/(p-1)), where p and e range over the primes and their exponents in the prime factorization of n.
%F From _Amiram Eldar_, Sep 18 2023: (Start)
%F Dirichlet g.f.: zeta(s-1) * zeta(2*s) * Product_{p prime} (1 - 1/p^s + 2/p^(2*s-1)).
%F Sum_{k=1..n} a(k) ~ c * n^2, where c = (1/2) * Product_{p prime} (1 - (p^2 - 2*p - 1)/(p^4 - 1)) = 0.48777088716109463306... . (End)
%e If n = 240, d = 12 then 2^max(r_j) = 2^max(2) = 2^4, 3^max(r_j) = 3^max(1) = 3^1, SEPSigma(240) = (1+2+4+8+16)*(-1+3)*(-1+5) = 248.
%p A125140 := proc(n) local ifs,i,a,r,p ; ifs := ifactors(n)[2] ; a := 1 ; for i from 1 to nops(ifs) do r := op(2,op(i,ifs)) ; p := op(1,op(i,ifs)) ; a := a*(p*(1-p^r)/(1-p)+(-1)^r) ; od ; RETURN(a) ; end: for n from 1 to 80 do printf("%d, ",A125140(n)) ; od ; # _R. J. Mathar_, Jun 07 2007
%t f[p_, e_] := (p^(e+1) - p)/(p - 1) + (-1)^e; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* _Amiram Eldar_, Sep 18 2023 *)
%o (PARI) A125140(n) = { my(f=factor(n), p, e); prod(k=1,#f~,p = f[k,1]; e = f[k,2]; ((-1)^e) + (((p^(e+1))-p) / (p-1))); }; \\ _Antti Karttunen_, Feb 21 2022
%K nonn,easy,mult
%O 1,3
%A _Yasutoshi Kohmoto_, Jan 12 2007, Jan 29 2007
%E More terms from _R. J. Mathar_, Jun 07 2007
%E Formula clarified by _Antti Karttunen_, Feb 21 2022