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.

Original entry on oeis.org

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, 21, 23, 25, 23, 26, 32, 28, 25, 24, 24, 31, 32, 33, 36, 41, 38, 38, 37, 44, 41, 37, 39, 47, 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
Offset: 1

Views

Author

Ilya Gutkovskiy, Jun 21 2024

Keywords

Comments

By "simple continued fraction" is meant a continued fraction whose terms are positive integers and the final term is >= 2.

Examples

			Sum_{k=1..7} (-1)^(k+1)/k = 319/420 = 1/(1 + 1/(3 + 1/(6 + 1/(3 + 1/5)))), so a(7) = 5.
		

Crossrefs

Programs

  • Mathematica
    Table[Length[ContinuedFraction[Sum[(-1)^(k + 1)/k, {k, 1, n}]]] - 1, {n, 1, 75}]
  • Python
    from fractions import Fraction
    from sympy.ntheory.continued_fraction import continued_fraction
    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