login
Denominator of H(n)/H(n-1), where H(n) is the n-th harmonic number = Sum_{k=1..n} 1/k.
5

%I #29 Feb 09 2021 19:38:48

%S 2,9,22,125,137,343,726,6849,7129,81191,83711,1118273,1145993,1171733,

%T 2391514,41421503,42142223,271211719,275295799,55835135,18858053,

%U 439143531,1332950097,33695573875,34052522467,309561680403,312536252003,9146733078187,9227046511387

%N Denominator of H(n)/H(n-1), where H(n) is the n-th harmonic number = Sum_{k=1..n} 1/k.

%C a(n) mod n^3 = 0 iff n is prime > 3. - _Gary Detlefs_, Jan 30 2013

%H Michael S. Branicky, <a href="/A193758/b193758.txt">Table of n, a(n) for n = 2..1001</a>

%F a(n) = denominator(H(n)/H(n-1)), where H(n) = Sum_{k=1..n} 1/k.

%F a(n) = numerator(n*H(n))-denominator(n*H(n)). - _Gary Detlefs_, Sep 05 2011

%p H:= n-> add(1/k, k=1..n): seq(denom(H(n)/H(n-1)), n=2..25);

%t h[n_] := Sum[1/i, {i, n}]; Table[Denominator[h[n]/h[n - 1]], {n, 2, 50}] (* _T. D. Noe_, Aug 04 2011 *)

%t Denominator[#[[2]]/#[[1]]]&/@Partition[HarmonicNumber[Range[30]],2,1] (* _Harvey P. Dale_, Jul 05 2015 *)

%o (Python)

%o from fractions import Fraction

%o def aupton(nn):

%o Hnm1, alst = Fraction(1, 1), []

%o for n in range(2, nn+1):

%o Hn = Hnm1 + Fraction(1, n)

%o alst.append((Hn/Hnm1).denominator)

%o Hnm1 = Hn

%o return alst

%o print(aupton(30)) # _Michael S. Branicky_, Feb 09 2021

%Y Cf. A001008, A002805.

%Y Numerators are in A096617.

%K nonn,frac

%O 2,1

%A _Gary Detlefs_, Aug 04 2011