OFFSET
1,2
FORMULA
a(n) is multiplicative with a(2^e) = (3-e) * 2^e if e>0, a(p^e) = (e+1) * p^e if p>2.
a(16*n + 8) = 0.
EXAMPLE
x + 4*x^2 + 6*x^3 + 4*x^4 + 10*x^5 + 24*x^6 + 14*x^7 + 27*x^9 + 40*x^10 + ...
MATHEMATICA
f[p_, e_] := (e+1) * p^e; f[2, e_] := (3-e) * 2^e; a[n_] := Times @@ f @@@ FactorInteger[n]; a[1] = 1; Array[a, 100] (* Amiram Eldar, Sep 05 2023 *)
PROG
(PARI) {a(n) = local(A, p, e); if( n<1, 0, A = factor(n); prod(k=1, matsize(A)[1], if(p = A[k, 1], e = A[k, 2]; if( p==2, (3-e), e+1) * p^e)))}
(PARI) {a(n) = if( n<1, 0, polcoeff( sum(k=1, n, k * x^k / (1 + (-x)^k)^2, x*O(x^n)), n))}
CROSSREFS
KEYWORD
sign,easy,mult
AUTHOR
Michael Somos, Aug 22 2008
STATUS
approved