OFFSET
0,1
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..5000
FORMULA
EXAMPLE
G.f. = 2 + 3*q + 3*q^2 - 24*q^3 + 3*q^4 + 18*q^5 - 24*q^6 + 24*q^7 + 3*q^8 + ...
MATHEMATICA
a[ n_] := If[ n < 1, 2 Boole[n == 0], 3 If[ Divisible[n, 3], -8, 1] DivisorSigma[ 1, n / (2^IntegerExponent[n, 2] 3^IntegerExponent[n, 3])]];
a[ n_] := If[ n < 1, 2 Boole[n == 0], 3 Times @@ (Which[ # < 3, 1, # == 3, -8, True, (#^(#2+1) - 1) / (# - 1)] & @@@ FactorInteger@n)];
PROG
(PARI) {a(n) = if( n<1, 2*(n==0), if( n%3, 3, -24) * sigma(n / (2^valuation(n, 2) * 3^valuation(n, 3))))};
(PARI) {a(n) = if( n<1, 2*(n==0), 3 * sumdiv(n, d, d*(d%2)) - if( n%3==0, 36 * sumdiv(n/3, d, d*(d%2))) + if( n%9==0, 81 * sumdiv(n/9, d, d*(d%2))))};
CROSSREFS
KEYWORD
sign
AUTHOR
Michael Somos, Apr 09 2017
STATUS
approved