cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A373893 a(n) is the length of the simple continued fraction for the n-th alternating harmonic number.

This page as a plain text file.
%I A373893 #9 Jun 29 2024 10:49:01
%S A373893 0,1,2,4,7,7,5,9,8,12,9,12,11,12,13,12,18,12,17,15,15,15,19,21,18,13,
%T A373893 21,23,25,23,26,32,28,25,24,24,31,32,33,36,41,38,38,37,44,41,37,39,47,
%U A373893 48,42,43,43,44,46,42,44,51,45,49,52,53,62,50,57,48,55,60,52,58,70,58,60,73,67
%N A373893 a(n) is the length of the simple continued fraction for the n-th alternating harmonic number.
%C A373893 By "simple continued fraction" is meant a continued fraction whose terms are positive integers and the final term is >= 2.
%e A373893 Sum_{k=1..7} (-1)^(k+1)/k = 319/420 = 1/(1 + 1/(3 + 1/(6 + 1/(3 + 1/5)))), so a(7) = 5.
%t A373893 Table[Length[ContinuedFraction[Sum[(-1)^(k + 1)/k, {k, 1, n}]]] - 1, {n, 1, 75}]
%o A373893 (Python)
%o A373893 from fractions import Fraction
%o A373893 from sympy.ntheory.continued_fraction import continued_fraction
%o A373893 def A373893(n): return len(continued_fraction(sum(Fraction(1 if k&1 else -1,k) for k in range(1,n+1))))-1 # _Chai Wah Wu_, Jun 27 2024
%Y A373893 Cf. A055573, A058312, A058313.
%K A373893 nonn
%O A373893 1,3
%A A373893 _Ilya Gutkovskiy_, Jun 21 2024