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.

A334715 A(n,k) = !n + [n > 0] * (k * n!), where !n = A000166(n) is subfactorial of n and [] is an Iverson bracket; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 0, 1, 1, 1, 1, 2, 3, 2, 1, 3, 5, 8, 9, 1, 4, 7, 14, 33, 44, 1, 5, 9, 20, 57, 164, 265, 1, 6, 11, 26, 81, 284, 985, 1854, 1, 7, 13, 32, 105, 404, 1705, 6894, 14833, 1, 8, 15, 38, 129, 524, 2425, 11934, 55153, 133496, 1, 9, 17, 44, 153, 644, 3145, 16974, 95473, 496376, 1334961
Offset: 0

Views

Author

Alois P. Heinz, May 08 2020

Keywords

Examples

			Square array A(n,k) begins:
     1,    1,     1,     1,     1,     1,     1,     1, ...
     0,    1,     2,     3,     4,     5,     6,     7, ...
     1,    3,     5,     7,     9,    11,    13,    15, ...
     2,    8,    14,    20,    26,    32,    38,    44, ...
     9,   33,    57,    81,   105,   129,   153,   177, ...
    44,  164,   284,   404,   524,   644,   764,   884, ...
   265,  985,  1705,  2425,  3145,  3865,  4585,  5305, ...
  1854, 6894, 11934, 16974, 22014, 27054, 32094, 37134, ...
  ...
		

Crossrefs

Columns k=0-3 give: A000166, A001120, A110043, A110149.
Rows n=0-3 give: A000012, A001477, A005408, A016933.
Main diagonal gives A334716.
Cf. A000142.

Programs

  • Maple
    A:= proc(n, k) option remember; `if`(n<2,
          (k-1)*n+1, n*A(n-1, k)+(-1)^n)
        end:
    seq(seq(A(n, d-n), n=0..d), d=0..10);
  • Mathematica
    A[n_, k_] := Subfactorial[n] + Boole[n>0] k n!;
    Table[A[n, d-n], {d, 0, 10}, {n, 0, d}] // Flatten (* Jean-François Alcover, Feb 11 2021 *)

Formula

E.g.f. of column k: (k*exp(x)*x+1)*exp(-x)/(1-x).
A(n,k) = A000166(n) + [n > 0] * (k * n!).
A(n,k) = (k-1)*n + 1 if n<2, A(n,k) = n*A(n-1, k) + (-1)^n if n>=2.

A110149 a(0) = 1, a(1) = 3; for n>1, a(n) = n*a(n-1) + (-1)^n.

Original entry on oeis.org

1, 3, 7, 20, 81, 404, 2425, 16974, 135793, 1222136, 12221361, 134434970, 1613219641, 20971855332, 293605974649, 4404089619734, 70465433915745, 1197912376567664, 21562422778217953, 409686032786141106, 8193720655722822121, 172068133770179264540
Offset: 0

Views

Author

Philippe Deléham, Sep 04 2005

Keywords

Comments

A000166, A001120 and A110043 have a similar recurrence.
a(n) = (n-1)*(a(n-1)+a(n-2)), n>2. - Gary Detlefs, Apr 11 2010

Crossrefs

Column k=3 of A334715.

Programs

  • Maple
    a:= proc(n) option remember;
          `if`(n<2, 2*n+1, n*a(n-1)+(-1)^n)
        end:
    seq(a(n), n=0..23);  # Alois P. Heinz, May 07 2020
  • Mathematica
    RecurrenceTable[{a[1]==3,a[n]==n a[n-1]+(-1)^n},a,{n,20}]  (* Harvey P. Dale, Nov 21 2011 *)

Formula

a(n) = A110043(n) + n! = A001120(n) + 2*n! = A000166(n) + 3*n! for n>0.
a(n) = 3*n! + floor((n!+1)/e) for n>0. - Gary Detlefs, Apr 11 2010
E.g.f.: (3*exp(x)*x+1)*exp(-x)/(1-x). - Alois P. Heinz, May 07 2020

Extensions

a(0)=1 prepended by Alois P. Heinz, May 07 2020
Showing 1-2 of 2 results.