OFFSET
1,5
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..20000
MATHEMATICA
b[n_] := b[n] = Which[n == 0, 0, 0 < n < 4, 1, EvenQ[n], b[n/2], Mod[n, 3] == 0, b[n/3], Mod[n, 6] == 1, (n-1)/3 + 1, Mod[n, 6] == 5, (n-5)/3 + 2];
a[n_] := a[n] = If[n == 1, 1, -Sum[b[n/d] a[d], {d, Most@ Divisors[n]}]];
Array[a, 100] (* Jean-François Alcover, Feb 16 2020 *)
PROG
(PARI)
up_to = 20000;
DirInverseCorrect(v) = { my(u=vector(#v)); u[1] = (1/v[1]); for(n=2, #v, u[n] = (-u[1])*sumdiv(n, d, if(d<n, v[n/d]*u[d], 0))); (u) }; \\ Compute the Dirichlet inverse of the sequence given in input vector v (correctly!)
v323881 = DirInverseCorrect(vector(up_to, n, A126760(n)));
A323881(n) = v323881[n];
CROSSREFS
KEYWORD
sign
AUTHOR
Antti Karttunen, Feb 08 2019
STATUS
approved