cp's OEIS Frontend

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.

Showing 1-2 of 2 results.

A353691 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.

Original entry on oeis.org

6, 120, 28, 234, 30, 270, 42, 29792, 252, 1120, 66, 234, 78, 840, 140, 200, 102, 2016, 114, 1170, 945, 1320, 138, 1080, 150, 1560, 756, 270, 174, 3360, 186, 1272960, 308, 2040, 210, 9720, 222, 2280, 364, 148960, 246, 1890, 258, 2574, 1260, 2760, 282, 600, 294
Offset: 1

Views

Author

Amiram Eldar, May 04 2022

Keywords

Comments

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.

Examples

			a(2) = 120 since 120 is the least number > 2 such that h(120)/h(2) = (16/3)/(4/3) = 4 is an integer.
		

Crossrefs

Similar sequences: A069789, A069797, A069805, A353692.

Programs

  • Mathematica
    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]
  • Python
    from math import prod, gcd
    from sympy import factorint
    def A353691_helper(n):
        f = factorint(n).items()
        return prod(p**e*(p-1)*(e+1) for p, e in f), prod(p**(e+1)-1 for p, e in f)
    def A353691(n):
        Hnp, Hnq = A353691_helper(n)
        g = gcd(Hnp, Hnq)
        Hnp //= g
        Hnq //= g
        k = n+1
        Hkp, Hkq = A353691_helper(k)
        while (Hkp*Hnq) % (Hkq*Hnp):
            k += 1
            Hkp, Hkq = A353691_helper(k)
        return k # Chai Wah Wu, May 07 2022

Formula

a(p) = 6*p for a prime p > 3.

A353692 a(n) is the least number k > n such that uh(k)/uh(n) is an integer, where uh(n) is the harmonic mean of the unitary divisors of n, or -1 if no such k exists.

Original entry on oeis.org

6, 20, 45, 72, 30, 60, 42, 272, 756, 120, 66, 18, 78, 140, 1890, 720, 102, 180, 114, 24, 315, 220, 138, 360, 150, 260, 3321, 504, 174, 7560, 186, 1440, 495, 340, 210, 52416, 222, 380, 585, 1360, 246, 420, 258, 792, 1512, 460, 282, 720, 294, 600, 765, 936, 318
Offset: 1

Views

Author

Amiram Eldar, May 04 2022

Keywords

Examples

			a(2) = 20 since 20 is the least number > 2 such that uh(20)/uh(2) = (8/3)/(4/3) = 2 is an integer.
		

Crossrefs

Similar sequences: A069789, A069797, A069805, A353691.

Programs

  • Mathematica
    uh[n_] := Module[{f = FactorInteger[n]}, n*2^Length[f]/Times @@ (1 + Power @@@ f)]; a[n_] := Module[{k = n + 1, uhn = uh[n]}, While[!IntegerQ[uh[k]/uhn], k++]; k]; Array[a, 30]

Formula

a(p) = 6*p for a prime p > 3.
Showing 1-2 of 2 results.