%I #16 May 07 2022 09:40:51
%S 6,120,28,234,30,270,42,29792,252,1120,66,234,78,840,140,200,102,2016,
%T 114,1170,945,1320,138,1080,150,1560,756,270,174,3360,186,1272960,308,
%U 2040,210,9720,222,2280,364,148960,246,1890,258,2574,1260,2760,282,600,294
%N a(n) is the least number k > n such that h(k)/h(n) is an integer, where h(n) is the harmonic mean of the divisors of n, or -1 if no such k exists.
%C Does a(n) exist for all n? If m is a harmonic number (A001599) and gcd(n, m) = 1, then a(n) exists and a(n) <= m*n, since h(m*n) = h(m)*h(n) and h(m) is an integer.
%H Amiram Eldar, <a href="/A353691/b353691.txt">Table of n, a(n) for n = 1..639</a>
%F a(p) = 6*p for a prime p > 3.
%e a(2) = 120 since 120 is the least number > 2 such that h(120)/h(2) = (16/3)/(4/3) = 4 is an integer.
%t h[n_] := DivisorSigma[0, n]/DivisorSigma[-1, n]; a[n_] := Module[{k = n + 1, hn = h[n]}, While[!IntegerQ[h[k]/hn], k++]; k]; Array[a, 30]
%o (Python)
%o from math import prod, gcd
%o from sympy import factorint
%o def A353691_helper(n):
%o f = factorint(n).items()
%o return prod(p**e*(p-1)*(e+1) for p, e in f), prod(p**(e+1)-1 for p, e in f)
%o def A353691(n):
%o Hnp, Hnq = A353691_helper(n)
%o g = gcd(Hnp, Hnq)
%o Hnp //= g
%o Hnq //= g
%o k = n+1
%o Hkp, Hkq = A353691_helper(k)
%o while (Hkp*Hnq) % (Hkq*Hnp):
%o k += 1
%o Hkp, Hkq = A353691_helper(k)
%o return k # _Chai Wah Wu_, May 07 2022
%Y Cf. A001599, A099377, A099378.
%Y Similar sequences: A069789, A069797, A069805, A353692.
%K nonn
%O 1,1
%A _Amiram Eldar_, May 04 2022