cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A068773 Alternating sum phi(1) - phi(2) + phi(3) - phi(4) + ... + ((-1)^(n+1))*phi(n).

This page as a plain text file.
%I A068773 #26 Aug 04 2024 20:36:09
%S A068773 1,0,2,0,4,2,8,4,10,6,16,12,24,18,26,18,34,28,46,38,50,40,62,54,74,62,
%T A068773 80,68,96,88,118,102,122,106,130,118,154,136,160,144,184,172,214,194,
%U A068773 218,196,242,226,268,248,280,256,308,290,330,306,342,314,372,356
%N A068773 Alternating sum phi(1) - phi(2) + phi(3) - phi(4) + ... + ((-1)^(n+1))*phi(n).
%H A068773 Amiram Eldar, <a href="/A068773/b068773.txt">Table of n, a(n) for n = 1..10000</a>
%H A068773 László Tóth, <a href="https://www.emis.de/journals/JIS/VOL20/Toth/toth25.html">Alternating Sums Concerning Multiplicative Arithmetic Functions</a>, Journal of Integer Sequences, Vol. 20 (2017), Article 17.2.1.
%F A068773 a(n) = Sum_{k=1..n} (-1)^(k+1)*phi(k).
%F A068773 a(n) = n^2/Pi^2 + O(n * log(n)^(2/3) * log(log(n))^(4/3)) (Tóth, 2017). - _Amiram Eldar_, Oct 14 2022
%F A068773 a(n) = 3*A002088(n) - 2*A049690(n). - _Ridouane Oudra_, Mar 22 2024
%F A068773 a(n) = A002088(n) - 2*A049690(floor(n/2)). - _Chai Wah Wu_, Aug 04 2024
%e A068773 a(3) = phi(1) - phi(2) + phi(3) = 1 - 1 + 2 = 2.
%p A068773 with(numtheory): seq(add((-1)^(k+1)*phi(k),k=1..n), n=1..80); # _Ridouane Oudra_, Mar 22 2024
%t A068773 Accumulate[Array[(-1)^(# + 1) * EulerPhi[#] &, 100]] (* _Amiram Eldar_, Oct 14 2022 *)
%o A068773 (PARI) a068773(m)=local(s,n); s=0; for(n=1,m, if(n%2==0,s=s-eulerphi(n),s=s+eulerphi(n)); print1(s,","))
%o A068773 (Python)
%o A068773 # uses code from A002088 and A049690
%o A068773 def A068773(n): return A002088(n)-(A049690(n>>1)<<1) # _Chai Wah Wu_, Aug 04 2024
%Y A068773 Cf. A000010, A067929.
%Y A068773 Cf. A002088, A049690.
%K A068773 easy,nonn
%O A068773 1,3
%A A068773 _Klaus Brockhaus_, Feb 28 2002