login
Dirichlet inverse of A126760.
8

%I #14 Jan 06 2021 09:06:39

%S 1,-1,-1,0,-2,1,-3,0,0,2,-4,0,-5,3,2,0,-6,0,-7,0,3,4,-8,0,-5,5,0,0,

%T -10,-2,-11,0,4,6,0,0,-13,7,5,0,-14,-3,-15,0,0,8,-16,0,-8,5,6,0,-18,0,

%U -3,0,7,10,-20,0,-21,11,0,0,-2,-4,-23,0,8,0,-24,0,-25,13,5,0,-2,-5,-27,0,0,14,-28,0,-5,15,10,0,-30,0,-1,0

%N Dirichlet inverse of A126760.

%H Antti Karttunen, <a href="/A323881/b323881.txt">Table of n, a(n) for n = 1..20000</a>

%t 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];

%t a[n_] := a[n] = If[n == 1, 1, -Sum[b[n/d] a[d], {d, Most@ Divisors[n]}]];

%t Array[a, 100] (* _Jean-François Alcover_, Feb 16 2020 *)

%o (PARI)

%o up_to = 20000;

%o 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!)

%o A126760(n) = {n&&n\=3^valuation(n, 3)<<valuation(n, 2); n%3+n\6*2}; \\ From A126760

%o v323881 = DirInverseCorrect(vector(up_to,n,A126760(n)));

%o A323881(n) = v323881[n];

%Y Cf. A126760, A323882, A323883, A323886.

%K sign

%O 1,5

%A _Antti Karttunen_, Feb 08 2019