|
|
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).
|
|
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
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|