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-2 of 2 results.

A276313 Number of weak up-down sequences of length n and values in {1,2,...,n}.

Original entry on oeis.org

1, 1, 3, 14, 85, 671, 6405, 72302, 940005, 13846117, 227837533, 4142793511, 82488063476, 1785049505682, 41715243815059, 1046997553798894, 28089178205661221, 802173732190546289, 24296253228394108980, 777918130180655893150, 26253270588637259772768
Offset: 0

Views

Author

Alois P. Heinz, Aug 29 2016

Keywords

Examples

			a(0) = 1: the empty sequence.
a(1) = 1: 1.
a(2) = 3: 11, 12, 22.
a(3) = 14: 111, 121, 122, 131, 132, 133, 221, 222, 231, 232, 233, 331, 332, 333.
a(4) = 85: 1111, 1112, 1113, 1114, 1211, ..., 4423, 4424, 4433, 4434, 4444.
		

Crossrefs

A diagonal of A050446, A050447.
Cf. A276312.

Programs

  • Maple
    b:= proc(n, k, t) option remember; `if`(n=0, 1,
          add(b(n-1, k, k-j), j=1..t))
        end:
    a:= n-> b(n, n+1, n):
    seq(a(n), n=0..25);
  • Mathematica
    b[n_, k_, t_] := b[n, k, t] = If[n==0, 1, Sum[b[n-1, k, k-j], {j, 1, t}]];
    a[n_] := b[n, n+1, n];
    Table[a[n], {n, 0, 25}](* Jean-François Alcover, May 18 2017, translated from Maple *)

Formula

a(n) ~ exp(1/2) * 2^(n+2) * n^n / Pi^(n+1). - Vaclav Kotesovec, Aug 30 2016

A373423 Array read by ascending antidiagonals: T(n, k) = [x^k] cf(n) where cf(0) = 1, cf(1) = -1/(x - 1), and for n > 1 is cf(n) = ~( ~x - 1/(~x - 1/(~x - 1/(~x - 1/(~x - ... 1/(~x + 1))))...) ) where '~' is '-' if n is even, and '+' if n is odd, and x appears n times in the expression.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 2, 1, 0, 1, 3, 1, 1, 0, 1, 4, 3, 1, 1, 0, 1, 5, 6, 5, 1, 1, 0, 1, 6, 10, 14, 8, 1, 1, 0, 1, 7, 15, 30, 31, 13, 1, 1, 0, 1, 8, 21, 55, 85, 70, 21, 1, 1, 0, 1, 9, 28, 91, 190, 246, 157, 34, 1, 1, 0, 1, 10, 36, 140, 371, 671, 707, 353, 55, 1, 1, 0
Offset: 0

Views

Author

Peter Luschny, Jun 09 2024

Keywords

Examples

			Generating functions of row n:
   gf0 = 1;
   gf1 =   - 1/( x-1);
   gf2 = x + 1/(-x+1);
   gf3 = x - 1/( x-1/( x+1));
   gf4 = x + 1/(-x-1/(-x-1/(-x+1)));
   gf5 = x - 1/( x-1/( x-1/( x-1/( x+1))));
   gf6 = x + 1/(-x-1/(-x-1/(-x-1/(-x-1/(-x+1)))));
.
Array begins:
  [0] 1, 0,  0,   0,   0,    0,     0,     0,      0, ...
  [1] 1, 1,  1,   1,   1,    1,     1,     1,      1, ...
  [2] 1, 2,  1,   1,   1,    1,     1,     1,      1, ...  A373565
  [3] 1, 3,  3,   5,   8,   13,    21,    34,     55, ...  A373566
  [4] 1, 4,  6,  14,  31,   70,   157,   353,    793, ...  A373567
  [5] 1, 5, 10,  30,  85,  246,   707,  2037,   5864, ...  A373568
  [6] 1, 6, 15,  55, 190,  671,  2353,  8272,  29056, ...  A373569
       A000217,  A006322,     A108675, ...
            A000330,   A085461,      A244881, ...
.
Triangle starts:
  [0] 1;
  [1] 1, 0;
  [2] 1, 1,  0;
  [3] 1, 2,  1,  0;
  [4] 1, 3,  1,  1,  0;
  [5] 1, 4,  3,  1,  1,  0;
  [6] 1, 5,  6,  5,  1,  1, 0;
		

Crossrefs

Cf. A373424, A276312 (main diagonal).
Columns include: A000217, A000330, A006322, A085461, A108675, A244881.

Programs

  • Maple
    row := proc(n, len) local x, a, j, ser;
    if n = 0 then a := -1 elif n = 1 then a := -1/(x - 1) elif irem(n, 2) = 1 then
      a :=  x + 1; for j from 1 to n-1 do a :=  x - 1 / a od: else
      a := -x + 1; for j from 1 to n-1 do a := -x - 1 / a od: fi;
    ser := series((-1)^(n-1)*a, x, len + 2); seq(coeff(ser, x, j), j = 0..len) end:
    A := (n, k) -> row(n, 12)[k+1]:      # array form
    T := (n, k) -> row(n - k, k+1)[k+1]: # triangular form
    seq(lprint([n], row(n, 9)), n = 0..9);
  • SageMath
    def Arow(n, len):
        R. = PowerSeriesRing(ZZ, len)
        if n == 0: return [1] + [0]*(len - 1)
        if n == 1: return [1]*(len - 1)
        x = x if n % 2 == 1 else -x
        a = x + 1
        for _ in range(n - 1):
            a = x - 1 / a
        if n % 2 == 0: a = -a
        return a.list()
    for n in range(8): print(Arow(n, 9))
Showing 1-2 of 2 results.