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.

Previous Showing 11-20 of 25 results. Next

A320955 Square array read by ascending antidiagonals: A(n, k) (n >= 0, k >= 0) = Sum_{j=0..n-1} (!j/j!)*((n - j)^k/(n - j)!) if k > 0 and 1 if k = 0. Here !n denotes the subfactorial of n.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 2, 1, 0, 1, 1, 2, 4, 1, 0, 1, 1, 2, 5, 8, 1, 0, 1, 1, 2, 5, 14, 16, 1, 0, 1, 1, 2, 5, 15, 41, 32, 1, 0, 1, 1, 2, 5, 15, 51, 122, 64, 1, 0, 1, 1, 2, 5, 15, 52, 187, 365, 128, 1, 0, 1, 1, 2, 5, 15, 52, 202, 715, 1094, 256, 1, 0
Offset: 0

Views

Author

Peter Luschny, Nov 05 2018

Keywords

Comments

Arndt and Sloane (see the link and A278984) identify the sequence to give "the number of words of length n over an alphabet of size b that are in standard order" and provide the formula Sum_{j = 1..b} Stirling_2(n, j) assuming b >= 1 and j >= 1. Compared to the array as defined here this misses the first row and the first column of our array.
The method used here is the special case of a general method described in A320956 applied to the function exp. For applications to other functions see the cross references.
A(k,n) is the number of color patterns (set partitions) for an oriented row of length n using up to k colors (subsets). Two color patterns are equivalent if the colors are permuted. For A(3,4) = 14, the six achiral patterns are AAAA, AABB, ABAB, ABBA, ABBC, and ABCA; the eight chiral patterns are the four chiral pairs AAAB-ABBB, AABA-ABAA, AABC-ABCC, and ABAC-ABCB. - Robert A. Russell, Nov 10 2018

Examples

			Array starts:
n\k   0  1  2  3   4   5    6    7     8      9  ...
----------------------------------------------------
[0]   1, 0, 0, 0,  0,  0,   0,   0,    0,     0, ...  A000007
[1]   1, 1, 1, 1,  1,  1,   1,   1,    1,     1, ...  A000012
[2]   1, 1, 2, 4,  8, 16,  32,  64,  128,   256, ...  A011782
[3]   1, 1, 2, 5, 14, 41, 122, 365, 1094,  3281, ...  A124302
[4]   1, 1, 2, 5, 15, 51, 187, 715, 2795, 11051, ...  A124303
[5]   1, 1, 2, 5, 15, 52, 202, 855, 3845, 18002, ...  A056272
[6]   1, 1, 2, 5, 15, 52, 203, 876, 4111, 20648, ...  A056273, ?A284727
[7]   1, 1, 2, 5, 15, 52, 203, 877, 4139, 21110, ...
[8]   1, 1, 2, 5, 15, 52, 203, 877, 4140, 21146, ...
[9]   1, 1, 2, 5, 15, 52, 203, 877, 4140, 21147, ...
----------------------------------------------------
Seen as a triangle given by the descending antidiagonals:
[0]             1
[1]            0, 1
[2]          0, 1, 1
[3]        0, 1, 1, 1
[4]       0, 1, 2, 1, 1
[5]     0, 1, 4, 2, 1, 1
[6]    0, 1, 8, 5, 2, 1, 1
[7]  0, 1, 16, 14, 5, 2, 1, 1
		

Crossrefs

Antidiagonal sums (and row sums of the triangle): A320964.
Cf. this sequence (exp), A320962 (log(x+1)), A320956 (sec+tan), A320958 (arcsin), A320959 (arctanh).
Cf. A320750 (unoriented), A320751 (chiral), A305749 (achiral).

Programs

  • Maple
    A := (n, k) -> if k = 0 then 1 else add(A008290(n, n-j)*(n-j)^k, j=0..n-1)/n! fi:
    seq(lprint(seq(A(n, k), k=0..9)), n=0..9); # Prints the array row-wise.
    seq(seq(A(n-k, k), k=0..n), n=0..11); # Gives the array as listed.
  • Mathematica
    T[n_, 0] := 1; T[n_, k_] := Sum[(Subfactorial[j]/Factorial[j])((n - j)^k/(n - j)!), {j, 0, n - 1}]; Table[T[n - k, k], {n, 0, 11}, {k, 0, n}] // Flatten
    Table[Sum[StirlingS2[k, j], {j, 0, n-k}], {n, 0, 11}, {k, 0, n}] // Flatten (* Robert A. Russell, Nov 10 2018 *)

Formula

A(n, k) = (1/n!)*Sum_{j=0..n-1} A008290(n, n-j)*(n-j)^k if k > 0.
If one drops the special case A(n, 0) = 1 from the definition then column 0 becomes Sum_{k=0..n} (-1)^k/k! = A103816(n)/A053556(n).
Row n is given for k >= 1 by a_n(k), where
a_0(k) = 0^k/0!.
a_1(k) = 1^k/1!.
a_2(k) = (2^k)/2!.
a_3(k) = (3^k + 3)/3!.
a_4(k) = (6*2^k + 4^k + 8)/4!.
a_5(k) = (20*2^k + 10*3^k + 5^k + 45)/5!.
a_6(k) = (135*2^k + 40*3^k + 15*4^k + 6^k + 264)/6!.
a_7(k) = (924*2^k + 315*3^k + 70*4^k + 21*5^k + 7^k + 1855)/7!.
a_8(k) = (7420*2^k + 2464*3^k + 630*4^k + 112*5^k + 28*6^k + 8^k + 14832)/8!.
Note that the coefficients of the generating functions a_n are the recontres numbers A000240, A000387, A000449, ...
Rewriting the formulas with exponential generating functions for the rows we have egf(n) = Sum_{k=0..n} !k*binomial(n,k)*exp(x*(n-k)) and A(n, k) = (k!/n!)*[x^k] egf(n). In this formulation no special rule for the case k = 0 is needed.
The rows converge to the Bell numbers. Convergence here means that for every fixed k the terms in column k differ from A000110(k) only for finitely many indices.
A(n, n) are the Bell numbers A000110(n) for n >= 0.
Let S(n, k) = Bell(n+k+1) - A(n, k+n+1) for n >= 0 and k >= 0, then the square array S(n, k) read by descending antidiagonals equals provable the triangle A137650 and equals empirical the transpose of the array A211561.

A145225 Triangle read by rows: T(n,k) is the number of odd permutations (of an n-set) with exactly k fixed points.

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 6, 0, 6, 0, 0, 20, 30, 0, 10, 0, 0, 135, 120, 90, 0, 15, 0, 0, 924, 945, 420, 210, 0, 21, 0, 0, 7420, 7392, 3780, 1120, 420, 0, 28, 0, 0, 66744, 66780, 33264, 11340, 2520, 756, 0, 36, 0, 0
Offset: 0

Views

Author

Abdullahi Umar, Oct 10 2008

Keywords

Examples

			Triangle starts:
   0;
   0,  0;
   1,  0, 0;
   0,  3, 0,  0;
   6,  0, 6,  0, 0;
  20, 30, 0, 10, 0, 0;
  ...
		

Crossrefs

Row sums are A001710 for n > 1.
Columns k=0..2 are A000387, A145222, A145223.

Programs

  • Maple
    A145225 := proc(n,k)
        binomial(n,k)*A000387(n-k) ; # re-use code of A000387
    end proc:
    seq(seq(A145225(n,k),k=0..n),n=0..12) ; # R. J. Mathar, Jul 06 2023
  • Mathematica
    A145225[n_, k_] := Binomial[n, k]*Binomial[n - k, 2]*Subfactorial[n - k - 2];
    Table[A145225[n, k], {n, 0, 10}, {k, 0, n}] (* Paolo Xausa, Jan 31 2025 *)

Formula

T(n,k) = C(n,k) * A000387(n-k).
E.g.f.: x^(k+2) * exp(-x) / (2*k!*(1-x)).
T(n,k) + A145224(n,k) = A008290(n,k). - R. J. Mathar, Jul 06 2023
T(n,k) = (A008290(n,k) - A055137(n,k)) / 2. - Julian Hatfield Iacoponi, Aug 08 2024

A065087 a(n) = A000166(n)*binomial(n+1,2).

Original entry on oeis.org

0, 0, 3, 12, 90, 660, 5565, 51912, 533988, 6007320, 73422855, 969181620, 13744757598, 208462156812, 3367465610145, 57727981888080, 1046800738237320, 20020064118788592, 402756584036805963, 8502638996332570140, 187953072550509445410, 4341715975916768188740
Offset: 0

Views

Author

N. J. A. Sloane, Nov 10 2001

Keywords

Comments

a(n) is also the number of permutations of [2n-1] having n-1 isolated fixed points (i.e. adjacent entries are not fixed points). Example: a(2)=3 because we have 132, 213, and 321. - Emeric Deutsch, Apr 18 2009

Crossrefs

Equals 3 * A000313(n+2).

Programs

  • Mathematica
    a[n_] := Subfactorial[n]*Binomial[n + 1, 2];
    Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Aug 18 2024 *)

Formula

a(n) = (n/2)*A000240(n+1). - Zerinvary Lajos, Dec 18 2007, corrected Jul 09 2012
a(n) = n * (n+1) * (a(n-1)/(n-1) + (-1)^n/2) for n > 1 - Seiichi Manyama, Jun 24 2018
E.g.f.: exp(-x)*x^2*(3 - 2*x + x^2)/(2*(1 - x)^3). - Ilya Gutkovskiy, Jun 25 2018

A145222 a(n) is the number of odd permutations (of an n-set) with exactly 1 fixed point.

Original entry on oeis.org

0, 0, 3, 0, 30, 120, 945, 7392, 66780, 667440, 7342335, 88107360, 1145396538, 16035550440, 240533257965, 3848532125760, 65425046139960, 1177650830516832, 22375365779822715, 447507315596450880, 9397653627525472470, 206748379805560389720, 4755212735527888968873
Offset: 1

Views

Author

Abdullahi Umar, Oct 09 2008

Keywords

Examples

			a(3) = 3 because there are exactly 3 odd permutations (of a 3-set) having 1 fixed point, namely: (12), (13), (23).
		

Crossrefs

Cf. A000387 (odd permutations with no fixed points), A145219 (even permutations with exactly 1 fixed point), A145223 (odd permutations with exactly 2 fixed points).

Programs

  • Mathematica
    A145222[n_] := n*Subfactorial[n - 3]*Binomial[n - 1, 2]; Array[A145222, 25] (* Paolo Xausa, Jan 31 2025 *)
  • PARI
    x = 'x + O('x^30); Vec(serlaplace(((x^3)*exp(-x))/(2*(1-x)))) \\ Michel Marcus, Apr 04 2016

Formula

a(n) = A145225(n,1) = n*A000387(n-1), (n > 0).
E.g.f.: x^3*exp(-x)/(2*(1-x)).
D-finite with recurrence (-n+3)*a(n) +n*(n-4)*a(n-1) +n*(n-1)*a(n-2)=0. - R. J. Mathar, Jul 06 2023

Extensions

More terms from Alois P. Heinz, Apr 04 2016

A180189 Number of permutations of [n] having exactly 1 circular succession. A circular succession in a permutation p of [n] is either a pair p(i), p(i+1), where p(i+1)=p(i)+1 or the pair p(n), p(1) if p(1)=p(n)+1.

Original entry on oeis.org

0, 2, 0, 12, 40, 270, 1848, 14840, 133488, 1334970, 14684560, 176214852, 2290792920, 32071101062, 481066515720, 7697064251760, 130850092279648, 2355301661033970, 44750731559645088, 895014631192902140, 18795307255050944520, 413496759611120779902
Offset: 1

Views

Author

Emeric Deutsch, Sep 06 2010

Keywords

Comments

For example, p=(4,1,2,5,3) has 2 circular successions: (1,2) and (3,4).

Examples

			a(4)=12 because we have 1*243, 142*3, 13*42, 31*24, 3142*, 431*2, 213*4, 4213*, 2*314, 2431*, 42*31, and 3*421 (the circular succession is marked *).
		

Crossrefs

Programs

  • Maple
    d[0] := 1: for n to 51 do d[n] := n*d[n-1]+(-1)^n end do: seq(n*(n-1)*d[n-2], n = 1 .. 22);

Formula

a(n) = n*(n-1)*d(n-2), where d(j)=A000166(j) are the derangement numbers.
a(n) = A180188(n,1).
E.g.f.: x^2 * exp(-x) / (1 - x). - Ilya Gutkovskiy, Oct 11 2021
a(n) = 2 * A000387(n). - Alois P. Heinz, Oct 11 2021
D-finite with recurrence (-n+2)*a(n) +n*(n-3)*a(n-1) +n*(n-1)*a(n-2)=0. - R. J. Mathar, Jul 26 2022

A060836 Number of permutations of n letters where exactly 5 change position.

Original entry on oeis.org

0, 0, 0, 0, 44, 264, 924, 2464, 5544, 11088, 20328, 34848, 56628, 88088, 132132, 192192, 272272, 376992, 511632, 682176, 895356, 1158696, 1480556, 1870176, 2337720, 2894320, 3552120, 4324320, 5225220, 6270264, 7476084, 8860544, 10442784, 12243264, 14283808, 16587648
Offset: 1

Views

Author

Robert Goodhand (rgoodhand(AT)hotmail.com), May 12 2001

Keywords

Examples

			a(8) = a(7) * 8/(8-5) = 924 * 8/3 = 2464.
		

Crossrefs

For changing 0, 1, 2, 3, 4, 5, n-4, n elements see A000012, A000004, A000217 (offset), A007290, A060008, A060836, A000475, A000166. Also see A000332, A008290.
Rencontre sequences are A000166 A000240 A000387 A000449 and A000475.
A diagonal of A008291.

Programs

Formula

a(n) = 44*binomial(n, 5).
a(n) = a(n-1)*n/(n-5).
G.f.: 44*x^5/(1 - x)^6. - Colin Barker, Apr 22 2012

A145223 a(n) is the number of odd permutations (of an n-set) with exactly 2 fixed points.

Original entry on oeis.org

0, 0, 6, 0, 90, 420, 3780, 33264, 333900, 3670920, 44054010, 572697840, 8017775766, 120266628300, 1924266063720, 32712523068960, 588825415259640, 11187682889909904, 223753657798227150, 4698826813762734240, 103374189902780197170, 2377606367763944481780
Offset: 2

Views

Author

Abdullahi Umar, Oct 09 2008

Keywords

Examples

			a(4) = 6 because there are exactly 6 odd permutations (of a 4-set) having 2 fixed points, namely: (12), (13), (14), (23), (24), (34).
		

Crossrefs

Cf. A000387 (odd permutations with no fixed points), A145222 (odd permutations with exactly 1 fixed point), A145220 (even permutations with exactly 2 fixed points).

Programs

  • Maple
    egf:= x^4 * exp(-x)/(4*(1-x));
    a:= n-> n! * coeff(series(egf, x, n+1), x, n):
    seq(a(n), n=2..30);  # Alois P. Heinz, Feb 01 2011
  • Mathematica
    A000387[n_] := Subfactorial[n-2] Binomial[n, 2];
    a[n_] := (n(n-1)/2) A000387[n-2];
    Table[a[n], {n, 2, 30}] (* Jean-François Alcover, Jan 30 2025 *)
  • PARI
    x = 'x + O('x^30); Vec(serlaplace(((x^4)*exp(-x))/(4*(1-x)))) \\ Michel Marcus, Apr 04 2016

Formula

a(n) = A145225(n,2) = (n*(n-1)/2) * A000387(n-2), (n > 1).
E.g.f.: x^4*exp(-x)/(4*(1-x)).
D-finite with recurrence +(-n+6)*a(n) +(n-2)*(n-7)*a(n-1) +(n-2)*(n-3)*a(n-2)=0. - R. J. Mathar, Jul 06 2023

Extensions

More terms from Alois P. Heinz, Feb 01 2011

A145880 Triangle read by rows: T(n,k) is the number of odd permutations of {1,2,...,n} with no fixed points and having k excedances (n>=1; k>=1).

Original entry on oeis.org

0, 1, 0, 0, 1, 4, 1, 0, 10, 10, 0, 1, 26, 81, 26, 1, 0, 56, 406, 406, 56, 0, 1, 120, 1681, 3816, 1681, 120, 1, 0, 246, 6210, 26916, 26916, 6210, 246, 0, 1, 502, 21433, 160054, 303505, 160054, 21433, 502, 1, 0, 1012, 70774, 852346, 2747008, 2747008, 852346, 70774
Offset: 1

Views

Author

Emeric Deutsch, Nov 06 2008

Keywords

Comments

Row n has n-1 entries (n>=2).
Sum of entries in row n = A000387(n).
Sum_{k=1..n-1} k*T(n,k) = A145886(n) (n>=2).

Examples

			T(4,2)=4 because the odd derangements of {1,2,3,4} with 2 excedances are 3142, 4312, 2413 and 3421.
Triangle starts:
  0;
  1;
  0,  0;
  1,  4,  1;
  0, 10, 10,  0;
  1, 26, 81, 26,  1;
		

Crossrefs

Programs

  • Maple
    G:=((1-t)*exp(-t*z)/(1-t*exp((1-t)*z))+(t*exp(-z)-exp(-t*z))/(1-t))*1/2: Gser:=simplify(series(G,z=0,15)): for n to 11 do P[n]:=sort(expand(factorial(n)*coeff(Gser,z,n))) end do: 0; for n to 11 do seq(coeff(P[n],t,j),j=1..n-1) end do; # yields sequence in triangular form

Formula

E.g.f.: ((1-t)*exp(-tz)/(1-t*exp((1-t)z)) + (t*exp(-z)-exp(-tz))/(1-t))/2.

Extensions

Formula corrected by N. J. A. Sloane, Jul 20 2017 at the request of the author.

A161937 The number of indirect isometries that are derangements of the (n-1)-dimensional facets of an n-cube.

Original entry on oeis.org

1, 2, 15, 116, 1165, 13974, 195643, 3130280, 56345049, 1126900970, 24791821351, 595003712412, 15470096522725, 433162702636286, 12994881079088595, 415836194530835024, 14138430614048390833, 508983502105742069970, 19341373080018198658879, 773654923200727946355140
Offset: 1

Views

Author

Elizabeth McMahon, Gary Gordon (mcmahone(AT)lafayette.edu), Jun 29 2009

Keywords

Comments

a(n) plays the same role as A000387 plays for the derangement numbers A000166.

Examples

			For a square, the 2 diagonal reflections are indirect edge derangements. For a 3-cube, the 15 rotary reflections are indirect face derangements.
		

Crossrefs

Programs

  • Maple
    a := n -> (-1)^(n+1)*n*hypergeom([1,1-n],[],2):
    seq(simplify(a(n)), n=1..20); # Peter Luschny, May 09 2017
  • Mathematica
    a[n_] := (-1)^(n + 1)*n*HypergeometricPFQ[{1, 1 - n}, {}, 2];
    Array[a, 20] (* Jean-François Alcover, Jul 14 2018, after Peter Luschny *)

Formula

a(n) = (b(n) + (-1)^(n+1))/2, where b(n) is sequence A000354, i.e., the number of (n-1)-dimensional facet derangements of an n-cube.
From Peter Luschny, May 09 2017: (Start)
a(n) = (-1)^(n+1)*n*hypergeom([1, 1-n], [], 2).
a(n) = (2^n*Gamma(n+1,-1/2)/exp(1/2)-(-1)^n)/2. (End)
E.g.f.: x*exp(-x) / (1 - 2*x). - Ilya Gutkovskiy, May 23 2020

Extensions

More terms from Peter Luschny, May 09 2017

A162974 Triangle read by rows: T(n,k) is the number of derangements of {1,2,...,n} having k cycles of length 2 (0 <= k <= floor(n/2)).

Original entry on oeis.org

1, 0, 0, 1, 2, 0, 6, 0, 3, 24, 20, 0, 160, 90, 0, 15, 1140, 504, 210, 0, 8988, 4480, 1260, 0, 105, 80864, 41040, 9072, 2520, 0, 809856, 404460, 100800, 18900, 0, 945, 8907480, 4447520, 1128600, 166320, 34650, 0, 106877320, 53450496, 13347180, 2217600
Offset: 0

Views

Author

Emeric Deutsch, Jul 22 2009

Keywords

Comments

Row n has 1 + floor(n/2) entries.
Sum of entries in row n = A000166(n) (the derangement numbers).
T(n,0) = A038205(n).
Sum_{k>=0} k*T(n,k) = A000387(n).

Examples

			T(4,2)=3 because we have (12)(34), (13)(24), and (14)(23).
Triangle starts:
    1;
    0;
    0,  1;
    2,  0;
    6,  0,  3;
   24, 20,  0;
  160, 90,  0, 15;
  ...
		

Crossrefs

T(2n,n) gives A001147.
T(2n+3,n) gives A000906(n) = 2*A000457(n).

Programs

  • Maple
    G := exp((1/2)*z*(t*z-z-2))/(1-z): Gser := simplify(series(G, z = 0, 16)): for n from 0 to 13 do P[n] := sort(expand(factorial(n)*coeff(Gser, z, n))) end do: for n from 0 to 13 do seq(coeff(P[n], t, j), j = 0 .. floor((1/2)*n)) end do;
    # second Maple program:
    b:= proc(n) option remember; expand(`if`(n=0, 1, add((j-1)!*
          `if`(j=2, x, 1)*b(n-j)*binomial(n-1, j-1), j=2..n)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..n/2))(b(n)):
    seq(T(n), n=0..14);  # Alois P. Heinz, Jan 27 2022
  • Mathematica
    b[n_] := b[n] = Expand[If[n == 0, 1, Sum[(j - 1)!*If[j == 2, x, 1]*b[n - j]*Binomial[n - 1, j - 1], {j, 2, n}]]];
    T[n_] := With[{p = b[n]}, Table[Coefficient[p, x, i], {i, 0, n/2}]];
    Table[T[n], {n, 0, 14}] // Flatten (* Jean-François Alcover, Sep 17 2024, after Alois P. Heinz *)

Formula

E.g.f.: G(t,z) = exp(z(tz-z-2)/2)/(1-z).
Previous Showing 11-20 of 25 results. Next