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.
%I A232111 #25 Nov 24 2021 19:14:20 %S A232111 0,1,1,1,1,7,1,11,13,11,11,23,23,607,251,251,25,97,97,3767,3767,3767, %T A232111 457,24319,24319,7951,4261,13703,13703,872843,872843,17424097, %U A232111 13828799,902339,7850449,7850449,7850449,1526171,68185267,3429883,3429883 %N A232111 Numerator of smallest nonnegative fraction of form +- 1 +- 1/2 +- 1/3 ... +- 1/n. %C A232111 Sequence A231692 includes a proof that a(n) is never 0 for n > 1. %e A232111 1-1/2-1/3-1/4+1/5 = 7/60. No other choice of term signs yields a smaller nonnegative fraction, so a(5) = 7. %e A232111 0/1, 1/1, 1/2, 1/6, 1/12, 7/60, 1/20, 11/420, 13/840, 11/2520, 11/2520, 23/27720, 23/27720, 607/360360, 251/360360, 251/360360, 25/144144, 97/12252240, ... %t A232111 nMax = 19; d = {0}; Table[d = Flatten[{d + 1/n, d - 1/n}]; Numerator[Min[Abs[d]]], {n, nMax}] (* _T. D. Noe_, Nov 20 2013 *) %o A232111 (PARI) a(n,t=0)=if(n==1,numerator(abs(n-t)),min(a(n-1,t-1/n),a(n-1,t+1/n))) \\ _Charles R Greathouse IV_, Apr 06 2014 %o A232111 (Python) %o A232111 from itertools import product %o A232111 from fractions import Fraction %o A232111 def A232111(n): return min(x for x in (sum(d[i]*Fraction(1,i+1) for i in range(n)) for d in product((1,-1),repeat=n)) if x >= 0).numerator # _Chai Wah Wu_, Nov 24 2021 %Y A232111 Cf. A232112 (denominators), A231692. %K A232111 nonn,frac %O A232111 0,6 %A A232111 _David W. Wilson_, Nov 18 2013