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.
%I A358936 #31 Jan 05 2025 19:51:42 %S A358936 3,4,6,38,40,88,244,578,581,602,1663,2196,10327,17358,28133,36163, %T A358936 42299,123556,149788,234900,350210,366321,620478,694950,869880,905807, %U A358936 934286,1907010,2005592,5026297,7675637,11492764,12844691,14400214,15444216,18798939,20300872 %N A358936 Numbers k such that for some r we have phi(1) + ... + phi(k - 1) = phi(k + 1) + ... + phi(k + r), where phi(i) = A000010(i). %C A358936 These numbers might be called "Euler totient function sequence balancing numbers", after the Behera and Panda link. %C A358936 Numbers k such that A002088(k-1) + A002088(k) is a term of A002088. %H A358936 Ctibor O. Zizka, <a href="/A358936/b358936.txt">Table of k < 10^9</a>, Terms 38..45 from David A. Corneth. %H A358936 A. Behera and G. K. Panda, <a href="https://web.archive.org/web/2024*/https://www.fq.math.ca/Scanned/37-2/behera.pdf">On the square roots of triangular numbers</a>, The Fibonacci Quarterly, 37.2 (1999), 98-105. %e A358936 k = 3: %e A358936 phi(1) + phi(2) = phi(4) = 2. %e A358936 Thus the balancing number k = 3 is a term. The balancer r is 1. %e A358936 k = 4: %e A358936 phi(1) + phi(2) + phi(3) = phi(5) = 4. %e A358936 Thus the balancing number k = 4 is a term. The balancer r is 1. %e A358936 phi(i) = A000010(i). %t A358936 With[{m = 30000},phi = EulerPhi[Range[m]]; s = Accumulate[phi]; Select[Range[2, m], MemberQ[s, 2*s[[#]] - phi[[#]]] &]] (* _Amiram Eldar_, Dec 07 2022 *) %o A358936 (Python) %o A358936 from sympy import totient as phi %o A358936 from itertools import count, islice %o A358936 def f(n): # function we wish to "balance" %o A358936 return phi(n) %o A358936 def agen(): # generator of terms %o A358936 s, sset, i = [0, f(1), f(1)+f(2)], set(), 3 %o A358936 for k in count(2): %o A358936 target = s[k-1] + s[k] %o A358936 while s[-1] < target: %o A358936 fi = f(i); nexts = s[-1] + fi; i += 1 %o A358936 s.append(nexts); sset.add(nexts) %o A358936 if target in sset: yield k %o A358936 print(list(islice(agen(), 17))) # _Michael S. Branicky_, Dec 07 2022 %o A358936 (PARI) upto(n) = {my(res = List(), lefttotal = 1, righttotal = 2, k = 2, nplusr = 3, sumf = 1, oldfk = 1); for(i = 1, n, while(lefttotal > righttotal, nplusr++; righttotal+=f(nplusr) ); if(lefttotal == righttotal, listput(res, k)); lefttotal+=oldfk; k++; fk = f(k); righttotal-=fk; oldfk = fk ); res } %o A358936 f(k) = eulerphi(k) \\ _David A. Corneth_, Dec 07 2022 %Y A358936 Cf. A000010, A001109, A002088, A064018. %K A358936 nonn %O A358936 1,1 %A A358936 _Ctibor O. Zizka_, Dec 07 2022 %E A358936 a(8)-a(15) from _Amiram Eldar_, Dec 07 2022 %E A358936 a(16)-a(37) from _Michael S. Branicky_, Dec 07 2022