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

%I #18 Aug 27 2023 10:37:02

%S 0,1,1,5,13,23,101,307,641,893,7303,9613,97249,122989,19793,48595,

%T 681971,818107,13093585,77107553,66022193,76603673,1529091919,

%U 1752184789,7690078169,8719737569,23184641107,3721854001,96460418429

%N 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).

%C 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

%F a(n) = denominator(Sum_{k=1..n} (-1)^(k+1)/k) - numerator(Sum_{k=1..n} (-1)^(k+1)/k).

%F a(n) = A058312(n) - A058313(n).

%F a(n) = A075829(n+1).

%F a(n) = numerator(Sum_{k=2..n} (-1)^k/k). (Cf. A024168.) - _Petros Hadjicostas_, May 17 2020

%t 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}]]

%o (PARI) a(n) = my(x=sum(k=1, n, (-1)^(k+1)/k)); denominator(x) - numerator(x); \\ _Michel Marcus_, May 07 2020

%Y Cf. A058312, A058313, A075829, A364317.

%K nonn,easy

%O 1,4

%A _Alexander Adamchuk_, Jul 22 2006

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 19 19:02 EDT 2024. Contains 371798 sequences. (Running on oeis4.)