A052488 a(n) = floor(n*H(n)) where H(n) is the n-th harmonic number, Sum_{k=1..n} 1/k (A001008/A002805).
1, 3, 5, 8, 11, 14, 18, 21, 25, 29, 33, 37, 41, 45, 49, 54, 58, 62, 67, 71, 76, 81, 85, 90, 95, 100, 105, 109, 114, 119, 124, 129, 134, 140, 145, 150, 155, 160, 165, 171, 176, 181, 187, 192, 197, 203, 208, 214, 219, 224, 230, 235, 241, 247, 252, 258, 263, 269
Offset: 1
References
- 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.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Magma
[Floor(n*HarmonicNumber(n)): n in [1..60]]; // G. C. Greubel, May 14 2019
-
Maple
for n from 1 to 100 do printf(`%d,`,floor(n*sum(1/k, k=1..n))) od: # Alternatively: A052488:= n -> floor(n*(Psi(n+1)+gamma)); seq(A052488(n),n=1..100); # Robert Israel, May 19 2014
-
Mathematica
f[n_] := Floor[n*HarmonicNumber[n]]; Array[f, 60] (* Robert G. Wilson v, Nov 23 2015 *)
-
PARI
a(n) = floor(n*sum(k=1, n, 1/k)) \\ Altug Alkan, Nov 23 2015
-
Python
from math import floor n=100 #number of terms ans=0 finalans = [] for i in range(1, n+1): ans+=(1/i) finalans.append(floor(ans*i)) print(finalans) # Adam Hugill, Feb 14 2022
-
Python
from fractions import Fraction from itertools import count, islice def agen(): Hn = 0 for n in count(1): Hn += Fraction(1, n) yield (n*Hn.numerator)//Hn.denominator print(list(islice(agen(), 60))) # Michael S. Branicky, Aug 10 2022
-
Python
from sympy import harmonic def A052488(n): return int(n*harmonic(n)) # Chai Wah Wu, Oct 24 2023
-
Sage
[floor(n*harmonic_number(n)) for n in (1..60)] # G. C. Greubel, May 14 2019
Extensions
More terms from James Sellers, Mar 17 2000
Comments