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.

A333072 Least k such that Sum_{i=1..n} k^i / i is a positive integer.

Original entry on oeis.org

1, 2, 6, 6, 30, 10, 70, 70, 210, 168, 1848, 1848, 18018, 8580, 2574, 2574, 102102, 102102, 831402, 2771340, 3233230, 587860, 43266496, 117630786, 162249360, 145088370, 145088370, 2897310, 672175920, 672175920, 18232771830, 18232771830, 44279588730, 8886561060
Offset: 1

Views

Author

Jinyuan Wang, Mar 10 2020

Keywords

Comments

Note that the denominator of (Sum_{i=1..n} k^i/i) - k^p/p can never be divisible by p, where n/2 < p <= n. Therefore, for the expression to be an integer, such p must divide k. Thus, a(n) = k is divisible by A055773(n).

Crossrefs

Programs

  • PARI
    a(n) = {my(m = prod(i=primepi(n/2)+1, primepi(n), prime(i)), k = m); while (denominator(sum(i=2, n, k^i/i)) != 1, k += m); k; }
    
  • Python
    from sympy import primorial, lcm
    def A333072(n):
        f = 1
        for i in range(1,n+1):
            f = lcm(f,i)
        f, glist = int(f), []
        for i in range(1,n+1):
            glist.append(f//i)
        m = 1 if n < 2 else primorial(n,nth=False)//primorial(n//2,nth=False)
        k = m
        while True:
            p,ki = 0, k
            for i in range(1,n+1):
                p = (p+ki*glist[i-1]) % f
                ki = (k*ki) % f
            if p == 0:
                return k
            k += m # Chai Wah Wu, Apr 04 2020

Formula

a(n) <= A034386(n).