login
Dirichlet inverse of A004718, Per Nørgård's "infinity sequence".
5

%I #13 Jan 06 2021 09:06:59

%S 1,1,-2,0,0,-2,-3,0,2,0,-1,0,1,-3,-4,0,0,2,-3,0,11,-1,-2,0,-3,1,0,0,2,

%T -4,-5,0,2,0,-1,0,1,-3,-8,0,-1,11,-2,0,16,-2,-3,0,10,-3,-4,0,-2,0,-1,

%U 0,8,2,1,0,3,-5,-26,0,0,2,-3,0,7,-1,-2,0,-3,1,12,0,8,-8,-5,0,-5,-1,-2,0,0,-2,-11,0,-2,16,-7,0,21,-3,-4,0,-3,10,0,0,2,-4,-5,0

%N Dirichlet inverse of A004718, Per Nørgård's "infinity sequence".

%C The composer Per Nørgård's name is also written in the OEIS as Per Noergaard.

%H Antti Karttunen, <a href="/A323886/b323886.txt">Table of n, a(n) for n = 1..16384</a>

%t b[0] = 0;

%t b[n_?EvenQ] := b[n] = -b[n/2];

%t b[n_] := b[n] = b[(n - 1)/2] + 1;

%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 = 65537;

%o A004718list(up_to) = { my(v=vector(up_to)); v[1]=1; v[2]=-1; for(n=3, up_to, v[n] = if(n%2, v[n>>1]+1, -v[n/2])); (v); }; \\ After code in A004718.

%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 v323886 = DirInverseCorrect(A004718list(up_to));

%o A323886(n) = v323886[n];

%Y Cf. A004718, A323881, A323887.

%K sign

%O 1,3

%A _Antti Karttunen_, Feb 08 2019