OFFSET
1,2
COMMENTS
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..10000
Terence Tao, Monotone non-decreasing sequences of the Euler totient function, arXiv:2309.02325 [math.NT], 2023. See Remark 4.7.
EXAMPLE
a(7) = 6 because A001615 is nondecreasing on 1,2,3,4,5,6 or 1,2,3,4,5,7 but not on 1,2,3,4,5,6,7.
PROG
(Python)
from math import prod
from bisect import bisect
from sympy import primefactors
def A371156(n):
def f(n):
r = primefactors(n)
return n*prod(p+1 for p in r)//prod(r)
plist, qlist, c = tuple(f(i) for i in range(1, n+1)), [0]*(n+1), 0
for i in range(n):
qlist[a:=bisect(qlist, plist[i], lo=1, hi=c+1, key=lambda x:plist[x])]=i
c = max(c, a)
return c
CROSSREFS
KEYWORD
nonn
AUTHOR
Chai Wah Wu, Apr 10 2024
STATUS
approved