OFFSET
0,3
LINKS
Robert Israel, Table of n, a(n) for n = 0..10000
R. Wyss, Identitäten bei den Stirling-Zahlen 2. Art aus kombinatorischen Überlegungen beim Würfelspiel, Elem. Math. 51 (1996) 102-106, Eq (5). [From R. J. Mathar, Aug 02 2009]
FORMULA
EXAMPLE
a(2)=3 since the probability of getting both coupons after two is 1/2, after 3 is 1/4, after 4 is 1/8, etc. and 2/2 + 3/2^2 + 4/2^3 + ... = 3.
MAPLE
H := proc(n)
add(1/k, k=1..n) ;
end proc:
A060293 := proc(n)
ceil(n*H(n)) ;
end proc: # R. J. Mathar, Aug 02 2009, Dec 02 2016
A060293:= n -> ceil(Psi(n+1)+gamma); # Robert Israel, May 19 2014
MATHEMATICA
f[n_] := Ceiling[n*HarmonicNumber[n]]; Array[f, 60, 0] (* Robert G. Wilson v, Nov 23 2015 *)
PROG
(PARI) vector(100, n, n--; ceil(n*sum(k=1, n, 1/k))) \\ Altug Alkan, Nov 23 2015
(Python)
from math import ceil
n=100 #number of terms
ans=0
finalans = [0]
for i in range(1, n+1):
ans+=(1/i)
finalans.append(ceil(ans*i))
print(finalans)
# Adam Hugill, Feb 14 2022
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Henry Bottomley, Mar 24 2001
STATUS
approved