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 A368372 #23 Jan 29 2024 10:38:08 %S A368372 0,1,4,29,111,103,472,2369,12965,30791,197346,452993,3337271,7485915, %T A368372 4160656,18358463,170991927,124184839,1278605110,110351535,98802055, %U A368372 211524139,2595194516,16562041459,219589922071,464651871609,2207044831642,4649180818987,70862100349605,148699793966557 %N A368372 a(n) = numerator of AM(n)-HM(n), where AM(n) and HM(n) are the arithmetic and harmonic means of the first n positive integers. %H A368372 Paolo Xausa, <a href="/A368372/b368372.txt">Table of n, a(n) for n = 1..2000</a> %e A368372 0, 1/6, 4/11, 29/50, 111/137, 103/98, 472/363, 2369/1522, 12965/7129, 30791/14762, 197346/83711, 452993/172042, 3337271/1145993, 7485915/2343466, 4160656/1195757, 18358463/4873118, ... %p A368372 AM:=proc(n) local i; (add(i,i=1..n)/n); end; %p A368372 HM:=proc(n) local i; (add(1/i,i=1..n)/n)^(-1); end; %p A368372 s1:=[seq(AM(n)-HM(n),n=1..50)]; %t A368372 A368372[n_] := Numerator[(n+1)/2 - n/HarmonicNumber[n]]; %t A368372 Array[A368372, 35] (* _Paolo Xausa_, Jan 29 2024 *) %o A368372 (Python) %o A368372 from fractions import Fraction %o A368372 from itertools import count, islice %o A368372 def agen(): # generator of terms %o A368372 A = H = 0 %o A368372 for n in count(1): %o A368372 A += n %o A368372 H += Fraction(1, n) %o A368372 yield ((A*Fraction(1, n) - n/H)).numerator %o A368372 print(list(islice(agen(), 30))) # _Michael S. Branicky_, Jan 24 2024 %o A368372 (Python) %o A368372 from fractions import Fraction %o A368372 from sympy import harmonic %o A368372 def A368372(n): return (Fraction(n+1,2)-Fraction(n,harmonic(n))).numerator # _Chai Wah Wu_, Jan 25 2024 %o A368372 (PARI) a368372(n) = numerator((n+1)/2 - n/harmonic(n)) \\ _Hugo Pfoertner_, Jan 25 2024 %Y A368372 Cf. A102928/A175441, A368366, A368373. %K A368372 nonn,frac %O A368372 1,3 %A A368372 _N. J. A. Sloane_, Jan 24 2024