%I #73 Sep 06 2023 03:07:39
%S 1,1,1,1,-1,1,1,1,1,-1,1,1,-1,1,-1,1,-1,1,1,-1,1,1,1,1,1,-1,1,1,-1,-1,
%T 1,1,1,-1,-1,1,-1,1,-1,-1,-1,1,1,1,-1,1,1,1,1,1,-1,-1,-1,1,-1,1,1,-1,
%U 1,-1,-1,1,1,1,1,1,1,-1,1,-1,1,1,-1,-1,1,1,1,-1,1,-1,1,-1,1,1,1,1,-1,1
%N a(n) = (-1)^A083025(n).
%C Also numerators of an infinite series which is equal to pi, if the denominators are the natural numbers A000027, for example: pi = 1/1 + 1/2 + 1/3 + 1/4 - 1/5 + 1/6 + 1/7 + 1/8 + 1/9 - 1/10 + 1/11 + 1/12 - 1/13 + 1/14 ... = 3.14159263... This remarkable result is due to Leonhard Euler. For another version see A209662.
%D Leonhard Euler, Introductio in analysin infinitorum, 1748.
%H Ray Chandler, <a href="/A209661/b209661.txt">Table of n, a(n) for n = 1..10000</a>
%F a(n) = A209662(n)/n.
%F Completely multiplicative with a(p) = -1 for p mod 4 = 1, a(p) = 1 otherwise. - _Andrew Howroyd_, Aug 04 2018
%e For n = 10 we have that the 10th row of triangle A207338 is [2, -5] therefore a(10) = 2*(-5)/10 = -1.
%t f[p_, e_] := If[Mod[p, 4] == 1, (-1)^e, 1]; a[n_] := Times @@ f @@@ FactorInteger[n]; a[1] = 1; Array[a, 100] (* _Amiram Eldar_, Sep 06 2023 *)
%o (PARI) a(n)={my(f=factor(n)); prod(i=1, #f~, my([p,e]=f[i,]); if(p%4==1, -1, 1)^e)} \\ _Andrew Howroyd_, Aug 04 2018
%Y Row products of triangle A207338 divided by n. Absolute values give A000012.
%Y Cf. A000027, A000796, A002144, A002145, A083025, A207338, A209662, A209921, A209922.
%K sign,frac,easy,mult
%O 1
%A _Omar E. Pol_, Mar 15 2012
%E Formula in sequence name from _M. F. Hasler_, Apr 16 2012
%E a(34) corrected by _Ray Chandler_, Mar 19 2016