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.

Showing 1-1 of 1 results.

A376023 a(1) = 1, for n >= 2, a(n) = abs(a(n - 1) + A376022(n)).

Original entry on oeis.org

1, 0, 3, 10, 17, 19, 19, 18, 15, 9, 6, 65, 74, 78, 80, 80, 79, 76, 71, 63, 49, 9, 62, 77, 85, 90, 93, 94, 93, 90, 85, 78, 68, 52, 21, 204, 247, 266, 277, 284, 288, 290, 290, 289, 286, 281, 274, 264, 250, 229, 192, 62, 150, 182, 201, 214, 223, 229, 233, 235, 235, 234, 231
Offset: 1

Views

Author

Ctibor O. Zizka, Sep 06 2024

Keywords

Examples

			a(1) = 1.
a(2) = abs(a(1) + A376022(2)) = abs(1+(-1)) = 0.
a(3) = abs(0 + A376022(3)) = abs(0 + (-3)) = 3.
a(4) = abs(3 + A376022(4)) = abs(3 + (-13)) = 10.
and so on.
		

Crossrefs

Cf. A376022.

Programs

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