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.

A376022 a(1) = 1, for n >= 2, a(n) = -1 + floor((n*a(n - 1)) / (n + a(n - 1))).

Original entry on oeis.org

1, -1, -3, -13, 7, 2, 0, -1, -3, -6, -15, 59, 9, 4, 2, 0, -1, -3, -5, -8, -14, -40, 53, 15, 8, 5, 3, 1, -1, -3, -5, -7, -10, -16, -31, -225, 43, 19, 11, 7, 4, 2, 0, -1, -3, -5, -7, -10, -14, -21, -37, -130, 88, 32, 19, 13, 9, 6, 4, 2, 0, -1, -3, -5, -7, -9, -12, -16, -22
Offset: 1

Views

Author

Ctibor O. Zizka, Sep 06 2024

Keywords

Comments

For x =< -2 and for some k, a(3*k*(k - 1)/2 + x) = -(2*x + 4).

Examples

			a(1) = 1.
a(2) = -1 + floor(2*a(1) / (2 + a(1))) = -1 + floor(2/3) = -1.
a(3) = -1 + floor(-3/2) = -3.
a(4) = -1 + floor(-12/1) = -13.
a(5) = -1 + floor(-65/-8) = 7.
and so on.
		

Crossrefs

Programs

  • Mathematica
    a[1] = 1; a[n_] := a[n] = -1 + Floor[n*a[n-1]/(n + a[n-1])]; Array[a, 100] (* Amiram Eldar, Sep 06 2024 *)
  • PARI
    lista(nn)= my(a=-2); vector(nn, n, a=-1+floor(n*a/(n+a))); \\ Ruud H.G. van Tol, Nov 28 2024
  • Python
    from itertools import count, islice
    def a_gen():
        a = 1
        for n in count(2):
            yield a
            b = -1+(n*a)//(n+a)
            a = b
    A376022_list = list(islice(a_gen(), 100)) # John Tyler Rascoe, Sep 17 2024
    

Formula

For x >= 0, k >= 2*x + 3 - floor((sqrt(9 + 8*x) - 1) / 2), a(3*k*(k-1)/2 + x) = -(2*x + 3).
For k >= 2, a(3*k*(k - 1)/2 - 1) = -1.