login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Dirichlet inverse of Thue-Morse sequence, A010060.
2

%I #9 Mar 03 2023 17:53:40

%S 1,-1,0,0,0,0,-1,0,0,0,-1,0,-1,1,0,0,0,0,-1,0,-1,1,0,0,-1,1,0,0,0,0,

%T -1,0,0,0,-1,0,-1,1,0,0,-1,1,0,0,0,0,-1,0,0,1,0,0,0,0,-1,0,0,0,-1,0,

%U -1,1,0,0,0,0,-1,0,-1,1,0,0,-1,1,0,0,2,0,-1,0,-1,1,0,0,0,0,-1,0,0,0,1,0,-1,1,0,0,-1,0,0,0,0,0,-1,0,0

%N Dirichlet inverse of Thue-Morse sequence, A010060.

%H Antti Karttunen, <a href="/A361017/b361017.txt">Table of n, a(n) for n = 1..65537</a>

%F a(1) = 1, and for n > 1, a(n) = -Sum_{d|n, d<n} A010060(n/d) * a(d).

%t a[1] = 1; a[n_] := a[n] = -DivisorSum[n, a[#] * ThueMorse[n/#] &, # < n &]; Array[a, 100] (* _Amiram Eldar_, Mar 02 2023 *)

%o (PARI)

%o A010060(n) = (hammingweight(n)%2);

%o memoA361017 = Map();

%o A361017(n) = if(1==n,1,my(v); if(mapisdefined(memoA361017,n,&v), v, v = -sumdiv(n,d,if(d<n,A010060(n/d)*A361017(d),0)); mapput(memoA361017,n,v); (v)));

%Y Cf. A010060, A361018 (parity of terms).

%K sign

%O 1,77

%A _Antti Karttunen_, Mar 02 2023