login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A119248 a(n) is the difference between denominator and numerator of the n-th alternating harmonic number Sum_{k=1..n} (-1)^(k+1)/k = A058313(n)/A058312(n). 1
0, 1, 1, 5, 13, 23, 101, 307, 641, 893, 7303, 9613, 97249, 122989, 19793, 48595, 681971, 818107, 13093585, 77107553, 66022193, 76603673, 1529091919, 1752184789, 7690078169, 8719737569, 23184641107, 3721854001, 96460418429 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,4
COMMENTS
a(n)/A058312(n) = 1 - A058313(n)/A058312(n) appears in the locker puzzle (see the links in A364317) for the probability of success with the strategy used there for n lockers and allowed openings of up to floor(n/2) lockers. Note that gcd(a(n), A058312(n)) = 1. - Wolfdieter Lang, Aug 12 2023
LINKS
FORMULA
a(n) = denominator(Sum_{k=1..n} (-1)^(k+1)/k) - numerator(Sum_{k=1..n} (-1)^(k+1)/k).
a(n) = A058312(n) - A058313(n).
a(n) = A075829(n+1).
a(n) = numerator(Sum_{k=2..n} (-1)^k/k). (Cf. A024168.) - Petros Hadjicostas, May 17 2020
MATHEMATICA
Denominator[Table[Sum[(-1)^(k+1)/k, {k, 1, n}], {n, 1, 30}]]-Numerator[Table[Sum[(-1)^(k+1)/k, {k, 1, n}], {n, 1, 30}]]
PROG
(PARI) a(n) = my(x=sum(k=1, n, (-1)^(k+1)/k)); denominator(x) - numerator(x); \\ Michel Marcus, May 07 2020
CROSSREFS
Sequence in context: A049833 A083800 A075829 * A114998 A340564 A140090
KEYWORD
nonn,easy
AUTHOR
Alexander Adamchuk, Jul 22 2006
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 18 15:48 EDT 2024. Contains 371780 sequences. (Running on oeis4.)