Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #15 Apr 04 2020 16:29:43
%S 1,2,6,6,30,10,70,70,210,168,1848,1848,18018,8580,2574,2574,102102,
%T 102102,831402,2771340,3233230,587860,43266496,117630786,162249360,
%U 145088370,145088370,2897310,672175920,672175920,18232771830,18232771830,44279588730,8886561060
%N Least k such that Sum_{i=1..n} k^i / i is a positive integer.
%C 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).
%H Chai Wah Wu, <a href="/A333072/b333072.txt">Table of n, a(n) for n = 1..61</a>
%F a(n) <= A034386(n).
%o (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; }
%o (Python)
%o from sympy import primorial, lcm
%o def A333072(n):
%o f = 1
%o for i in range(1,n+1):
%o f = lcm(f,i)
%o f, glist = int(f), []
%o for i in range(1,n+1):
%o glist.append(f//i)
%o m = 1 if n < 2 else primorial(n,nth=False)//primorial(n//2,nth=False)
%o k = m
%o while True:
%o p,ki = 0, k
%o for i in range(1,n+1):
%o p = (p+ki*glist[i-1]) % f
%o ki = (k*ki) % f
%o if p == 0:
%o return k
%o k += m # _Chai Wah Wu_, Apr 04 2020
%Y Cf. A034386, A055773, A332734, A333196.
%K nonn
%O 1,2
%A _Jinyuan Wang_, Mar 10 2020