Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #25 Dec 31 2022 01:47:34
%S 1,0,-1,0,-1,0,-1,0,1,0,-1,0,-1,0,1,0,-1,0,-1,0,1,0,-1,0,1,0,-1,0,-1,
%T 0,-1,0,1,0,1,0,-1,0,1,0,-1,0,-1,0,-1,0,-1,0,1,0,1,0,-1,0,1,0,1,0,-1,
%U 0,-1,0,-1,0,1,0,-1,0,1,0,-1,0,-1,0,-1,0,1,0,-1,0,1,0,-1,0,1,0,1,0,-1,0,1,0,1,0,1,0,-1,0,-1,0,-1,0,-1,0,-1
%N Totally multiplicative sequence with a(p) = a(p-1) - 1 for prime p.
%C From _Antti Karttunen_, Dec 30 2022: (Start)
%C Note the correspondences between four sequences:
%C A087003 --- abs ---> A323239
%C ^ ^
%C | |
%C inv inv
%C | |
%C v v
%C A000035 <--- abs --- A166698 (this sequence)
%C Here inv means that the sequences are Dirichlet Inverses of each other, and abs means taking absolute values.
%C (End)
%H Antti Karttunen, <a href="/A166698/b166698.txt">Table of n, a(n) for n = 1..65537</a>
%F Multiplicative with a(p^e) = (a(p-1)-1)^e.
%F If n = Product p(k)^e(k) then a(n) = Product (a(p(k)-1)-1)^e(k).
%F Multiplicative with a(p^e) = 0 if p = 2, with a(p^e) = 1 if p > 2 and e is even, with a(p^e) = -1 if p > 2 and e is odd.
%F a(p) = -1 for prime p > 2.
%F a(1) = 1, for k >= 1: a(2k) = 0, a(2k - 1) = 1 if A001222(2k - 1) is even, a(2k - 1) = -1 if A001222(2k - 1) is odd, where A001222(n) = bigomega(n).
%F Sum_{d|n} a(d) * A000012(d) = Sum_{d|n} a(d) * A000012(d/n) = A053866(n) = A093709(n) for n>= 1.
%F a(n) = A000035(n) * A008836(n). - _Antti Karttunen_, Sep 14 2017
%F From Antti Karttunen_, Dec 19 & Dec 30 2022: (Start)
%F a(A003961(n)) = A008836(n).
%F a(n) = A353557(n) - A353558(n).
%F (End)
%o (Scheme, with memoization-macro) (definec (A166698 n) (if (= 1 n) n (* (+ -1 (A166698 (+ -1 (A020639 n)))) (A166698 (A032742 n))))) ;; _Antti Karttunen_, Sep 14 2017
%o (PARI) A166698(n) = { my(f = factor(n)); prod(k=1, #f~, if(2==f[k, 1], 0, (-1)^f[k, 2])); }; \\ _Antti Karttunen_, Dec 19 2022
%Y Cf. A000035 (absolute values), A001222, A003961, A008836, A323239 (Dirichlet inverse).
%Y Cf. A046337 (positions of positive terms), A067019 (of negative terms), A353557, A353558.
%Y Cf. also A358839, A359378.
%K sign,mult
%O 1,1
%A _Jaroslav Krizek_, Oct 18 2009
%E More terms from _Antti Karttunen_, Sep 14 2017