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.

A052488 a(n) = floor(n*H(n)) where H(n) is the n-th harmonic number, Sum_{k=1..n} 1/k (A001008/A002805).

This page as a plain text file.
%I A052488 #73 Jul 02 2025 16:01:58
%S A052488 1,3,5,8,11,14,18,21,25,29,33,37,41,45,49,54,58,62,67,71,76,81,85,90,
%T A052488 95,100,105,109,114,119,124,129,134,140,145,150,155,160,165,171,176,
%U A052488 181,187,192,197,203,208,214,219,224,230,235,241,247,252,258,263,269
%N A052488 a(n) = floor(n*H(n)) where H(n) is the n-th harmonic number, Sum_{k=1..n} 1/k (A001008/A002805).
%C A052488 Floor(n*H(n)) gives a (very) rough approximation to the n-th prime.
%C A052488 a(n) is the integer part of the solution to the Coupon Collector's Problem. For example, if there are n=4 different prizes to collect from cereal boxes and they are equally likely to be found, then the integer part of the average number of boxes to buy before the collection is complete is a(4)=8. - Ron Lalonde (ronronronlalonde(AT)hotmail.com), Feb 04 2004
%D A052488 John D. Barrow, One Hundred Essential Things You Didn't Know You Didn't Know, Ch. 3, 'On the Cards', W. W. Norton & Co., NY & London, 2008, pp. 30-32.
%H A052488 Robert Israel, <a href="/A052488/b052488.txt">Table of n, a(n) for n = 1..10000</a>
%p A052488 for n from 1 to 100 do printf(`%d,`,floor(n*sum(1/k, k=1..n))) od:
%p A052488 # Alternatively:
%p A052488 A052488:= n -> floor(n*(Psi(n+1)+gamma));
%p A052488 seq(A052488(n),n=1..100); # _Robert Israel_, May 19 2014
%t A052488 f[n_] := Floor[n*HarmonicNumber[n]]; Array[f, 60] (* _Robert G. Wilson v_, Nov 23 2015 *)
%o A052488 (PARI) a(n) = floor(n*sum(k=1, n, 1/k)) \\ _Altug Alkan_, Nov 23 2015
%o A052488 (Magma) [Floor(n*HarmonicNumber(n)): n in [1..60]]; // _G. C. Greubel_, May 14 2019
%o A052488 (Sage) [floor(n*harmonic_number(n)) for n in (1..60)] # _G. C. Greubel_, May 14 2019
%o A052488 (Python)
%o A052488 from math import floor
%o A052488 n=100 #number of terms
%o A052488 ans=0
%o A052488 finalans = []
%o A052488 for i in range(1, n+1):
%o A052488     ans+=(1/i)
%o A052488     finalans.append(floor(ans*i))
%o A052488 print(finalans)
%o A052488 # _Adam Hugill_, Feb 14 2022
%o A052488 (Python)
%o A052488 from fractions import Fraction
%o A052488 from itertools import count, islice
%o A052488 def agen():
%o A052488     Hn = 0
%o A052488     for n in count(1):
%o A052488         Hn += Fraction(1, n)
%o A052488         yield (n*Hn.numerator)//Hn.denominator
%o A052488 print(list(islice(agen(), 60))) # _Michael S. Branicky_, Aug 10 2022
%o A052488 (Python)
%o A052488 from sympy import harmonic
%o A052488 def A052488(n): return int(n*harmonic(n)) # _Chai Wah Wu_, Oct 24 2023
%Y A052488 Cf. A001008, A002805, A006218, A060293.
%Y A052488 Cf. A001620, A073004.
%K A052488 easy,nonn
%O A052488 1,2
%A A052488 Tomas Mario Kalmar (TomKalmar(AT)aol.com), Mar 15 2000
%E A052488 More terms from _James Sellers_, Mar 17 2000