OFFSET
1,1
COMMENTS
By definition (m+1)*phi(a(n)) = m*sigma(a(n)) where m=A065824(n+1).
EXAMPLE
PROG
(Python)
from math import prod
from itertools import count
from sympy import factorint, primepi
def A065884(n):
m, k = n, primepi(n+1) + n + (n+1>>1)
while m != k:
m, k = k, primepi(k) + n + (k>>1)
m = m-1>>1
for k in count(1):
f = factorint(k)
if (m+1)*k*prod((p-1)**2 for p in f)==m*prod(p**(e+2)-p for p, e in f.items()):
return k # Chai Wah Wu, Aug 12 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Nov 27 2001
EXTENSIONS
Name corrected and more terms from Sean A. Irvine, Sep 17 2023
STATUS
approved