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.

A333074 Least k such that Sum_{i=0..n} (-k)^i / i! is a positive integer.

This page as a plain text file.
%I A333074 #19 Apr 02 2020 11:32:53
%S A333074 1,1,2,3,4,30,6,28,120,84,210,1650,210,11440,6930,630,9240,353430,
%T A333074 93450,746130,1616160,746130,1021020,11104170,56705880,9722790,
%U A333074 48498450,174594420,87297210,222071850,2114532420,11480905800,5375910540,42223261080,5603554110,2043061020
%N A333074 Least k such that Sum_{i=0..n} (-k)^i / i! is a positive integer.
%C A333074 Note that Sum_{i=0..n-1} (-k)^i / i! has a denominator that divides (n-1)! for n > 0. Therefore, for the expression to be an integer, (-k)^n / n! must have a denominator that divides (n-1)!. Thus, k^n is divisible by n, a(n) = k is divisible by A007947(n).
%C A333074 a(n) is the smallest integer k such that Gamma(n+1,-k)/(n!*e^k) is a positive integer, where Gamma is the upper incomplete gamma function. - _Chai Wah Wu_, Apr 01 2020
%F A333074 a(n) <= A034386(n).
%o A333074 (PARI) a(n) = {my(m = factorback(factorint(n)[, 1]), k = m); while(denominator(sum(i=2, n, (-k)^i/i!)) != 1, k += m); !n+k; }
%o A333074 (Python)
%o A333074 from functools import reduce
%o A333074 from operator import mul
%o A333074 from sympy import primefactors, factorial
%o A333074 def A333074(n):
%o A333074     f, g = int(factorial(n)), []
%o A333074     for i in range(n+1):
%o A333074         g.append(int(f//factorial(i)))
%o A333074     m = 1 if n < 2 else reduce(mul, primefactors(n))
%o A333074     k = m
%o A333074     while True:
%o A333074         p, ki = 0, 1
%o A333074         for i in range(n+1):
%o A333074             p = (p+ki*g[i]) % f
%o A333074             ki = (-k*ki) % f
%o A333074         if p == 0:
%o A333074             return k
%o A333074         k += m # _Chai Wah Wu_, Apr 01 2020
%Y A333074 Cf. A000142, A007949, A034386, A332734, A333073.
%K A333074 nonn
%O A333074 0,3
%A A333074 _Jinyuan Wang_, Mar 31 2020
%E A333074 a(27)-a(35) from _Chai Wah Wu_, Apr 01 2020