|
|
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).
|
|
1
|
|
|
3, 4, 6, 38, 40, 88, 244, 578, 581, 602, 1663, 2196, 10327, 17358, 28133, 36163, 42299, 123556, 149788, 234900, 350210, 366321, 620478, 694950, 869880, 905807, 934286, 1907010, 2005592, 5026297, 7675637, 11492764, 12844691, 14400214, 15444216, 18798939, 20300872
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
These numbers might be called "Euler totient function sequence balancing numbers", after the Behera and Panda link.
|
|
LINKS
|
|
|
EXAMPLE
|
k = 3:
phi(1) + phi(2) = phi(4) = 2.
Thus the balancing number k = 3 is a term. The balancer r is 1.
k = 4:
phi(1) + phi(2) + phi(3) = phi(5) = 4.
Thus the balancing number k = 4 is a term. The balancer r is 1.
|
|
MATHEMATICA
|
With[{m = 30000}, phi = EulerPhi[Range[m]]; s = Accumulate[phi]; Select[Range[2, m], MemberQ[s, 2*s[[#]] - phi[[#]]] &]] (* Amiram Eldar, Dec 07 2022 *)
|
|
PROG
|
(Python)
from sympy import totient as phi
from itertools import count, islice
def f(n): # function we wish to "balance"
return phi(n)
def agen(): # generator of terms
s, sset, i = [0, f(1), f(1)+f(2)], set(), 3
for k in count(2):
target = s[k-1] + s[k]
while s[-1] < target:
fi = f(i); nexts = s[-1] + fi; i += 1
s.append(nexts); sset.add(nexts)
if target in sset: yield k
(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 }
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|