%I #53 Jan 10 2025 12:38:28
%S 2,-1,-1,0,-1,2,-1,0,0,2,-1,0,-1,2,2,0,-1,0,-1,0,2,2,-1,0,0,2,0,0,-1,
%T -1,-1,0,2,2,2,0,-1,2,2,0,-1,-1,-1,0,0,2,-1,0,0,0,2,0,-1,0,2,0,2,2,-1,
%U 0,-1,2,0,0,2,-1,-1,0,2,-1,-1,0,-1,2,0,0,2,-1
%N a(n) = 2*b(n), where b(n) is defined by the condition that Product_{d|n} (b(d) + 1) = 1, n > 1 and b(1) = 1.
%C We can see from the formula that:
%C Product_{d|n} (moebius(d)*(moebius(d) + 3) + 4) = 4^d(n), for n > 1, where moebius(n) and d(n) are A008683 and A000005 respectively.
%C It also can be proved that
%C Product_{d|n} ((moebius(d) - 3/2 + I*sqrt(7)/2)) = Product_{d|n} ((moebius(d) - 3/2 - I*sqrt(7)/2)) is an integer iff n belongs to A048109, where I = sqrt(-1).
%H Antti Karttunen, <a href="/A262804/b262804.txt">Table of n, a(n) for n = 1..10000</a>
%H <a href="/index/Eu#epf">Index entries for sequences computed from exponents in factorization of n</a>
%F a(p) = -1 if p is prime.
%F a(n) = 2*moebius(n) if moebius(n) = 1;
%F a(n) = moebius(n) if moebius(n) != 1.
%F And in general:
%F a(n) = moebius(n)*(moebius(n) + 3)/2.
%e If p is prime, (b(p)+1)(b(1)+1) = 1 => b(p)+1 = 1/2 => b(p) = -1/2 => a(p) = 2*b(p) = -1.
%e For n=6, (1+b(1))(1+b(2))(1+b(3))(1+b(6)) = 1 => 2*(1/2)*(1/2)*(1+b(6)) = 1 => b(6) = 1 => a(6) = 2*b(6) = 2. - Example corrected by _Antti Karttunen_, Jul 25 2017
%p b:= proc(n) option remember; if n>1 then (1)/(mul((1+b(d)),d = numtheory:-divisors(n) minus {n}))-1 else 1; end if; end proc: b(1):= 1:a(i):=2*b(i): L:=seq(a(i), i=1..200);
%t Table[MoebiusMu[n] (MoebiusMu[n] + 3) / 2, {n, 80}] (* _Vincenzo Librandi_, Jan 19 2016 *)
%o (PARI) a(n) = moebius(n)*(moebius(n)+3)/2; \\ _Michel Marcus_, Jan 19 2016
%o (Magma) [MoebiusMu(n)*(MoebiusMu(n)+3)/2: n in [1..100]]; // _Vincenzo Librandi_, Jan 19 2016
%Y Cf. A000005, A008683, A048109.
%K sign
%O 1,1
%A _Gevorg Hmayakyan_, Jan 17 2016