OFFSET
1,3
COMMENTS
Might be called (-1)sigma(n). If x = Product p_i^r_i, then (-1)sigma(x) = Product (-1 + Sum p_i^s_i, s_i = 1 to r_i) = Product ((p_i^(r_i+1)-1)/(p_i-1)-2), with (-1)sigma(1) = 1. - Yasutoshi Kohmoto, May 23 2005
LINKS
R. J. Mathar, Table of n, a(n) for n = 1..100000
FORMULA
a(n) = Sum_{d|n} d*(-1)^A001221(d).
Multiplicative with a(p^e) = (p^(e+1)-2*p+1)/(p-1).
Simpler: a(p^e) = (p^(e+1)-1)/(p-1)-2. - M. F. Hasler, Sep 21 2022
Sum_{k=1..n} a(k) ~ c * n^2, where c = (Pi^2/12) * Product_{p prime} (1 - 2/p^2 + 2/p^3) = 0.4478559359... . - Amiram Eldar, Oct 25 2022
MAPLE
MATHEMATICA
a[p_?PrimeQ] := p-1; a[1] = 1; a[n_] := Times @@ ((#[[1]]^(#[[2]] + 1) - 2*#[[1]] + 1)/(#[[1]] - 1) & ) /@ FactorInteger[n]; Table[a[n], {n, 1, 71}] (* Jean-François Alcover, May 21 2012 *)
PROG
(PARI) A049060(n)={ local(i, resul, rmax, p) ; if(n==1, return(1) ) ; i=factor(n) ; rmax=matsize(i)[1] ; resul=1 ; for(r=1, rmax, p=0 ; for(j=1, i[r, 2], p += i[r, 1]^j ; ) ; resul *= p-1 ; ) ; return(resul) ; } { for(n=1, 40, print(n, " ", A049060(n)) ) ; } \\ R. J. Mathar, Oct 12 2006
(PARI) apply( A049060(n)=vecprod([(f[1]^(f[2]+1)-1)\(f[1]-1)-2 | f<-factor(n)~]), [1..99]) \\ M. F. Hasler, Sep 21 2022
(Python)
from math import prod
from sympy import factorint
def A049060(n): return prod((p**(e+1)-2*p+1)//(p-1) for p, e in factorint(n).items()) # Chai Wah Wu, Sep 13 2021
CROSSREFS
KEYWORD
easy,nonn,nice,mult
AUTHOR
EXTENSIONS
More terms from James A. Sellers, May 03 2000
Better description from Vladeta Jovovic, Apr 06 2002
STATUS
approved