A259030 a(n) is multiplicative with a(2^e) = -(1 - (-1)^e) / 2 if e > 0, a(p^e) = Kronecker(5, p)^e if p > 2.
1, -1, -1, 0, 0, 1, -1, -1, 1, 0, 1, 0, -1, 1, 0, 0, -1, -1, 1, 0, 1, -1, -1, 1, 0, 1, -1, 0, 1, 0, 1, -1, -1, 1, 0, 0, -1, -1, 1, 0, 1, -1, -1, 0, 0, 1, -1, 0, 1, 0, 1, 0, -1, 1, 0, 1, -1, -1, 1, 0, 1, -1, -1, 0, 0, 1, -1, 0, 1, 0, 1, -1, -1, 1, 0, 0, -1, -1
Offset: 1
Examples
G.f. = x - x^2 - x^3 + x^6 - x^7 - x^8 + x^9 + x^11 - x^13 + x^14 - x^17 + ...
Programs
-
Mathematica
f[p_, e_] := KroneckerSymbol[5, p]^e; f[2, e_] := -(1 - (-1)^e) / 2; a[n_] := Times @@ f @@@ FactorInteger[n]; a[1] = 1; Array[a, 100] (* Amiram Eldar, Sep 04 2023 *)
-
PARI
{a(n) = my(A, p, e); if( !n, 0, A = factor(abs(n)); prod(k=1, matsize(A)[1], [p, e] = A[k,]; if( p==2, -(e%2), kronecker( 5, p)^e)))};