OFFSET
1
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
FORMULA
EXAMPLE
G.f. = x - x^3 + x^4 - x^5 + x^7 - x^11 - x^12 + x^13 + x^15 + x^16 + ...
MATHEMATICA
f[p_, e_] := If[Mod[p, 6] == 1, 1, (-1)^e]; f[2, e_] := (1 + (-1)^e) / 2; f[3, 1] = -1; f[3, e_] := 0; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Sep 02 2023 *)
PROG
(PARI) {a(n) = my(A, p, e); if( !n, 0, A = factor(abs(n)); sign(n) * prod(k=1, matsize(A)[1], [p, e] = A[k, ]; if( p==2, !(e%2), p==3, -(e==1), kronecker( -12, p)^e)))};
(Haskell)
import Data.List (transpose)
a259024 n = a259024_list !! (n-1)
a259024_list = concat
(transpose [drop 2 cs, [0, 0 ..], drop 7 cs, a259024_list])
where cs = map negate a259022_list
-- Reinhard Zumkeller, Jun 17 2015
CROSSREFS
KEYWORD
sign,easy,mult
AUTHOR
Michael Somos, Jun 16 2015
STATUS
approved