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 91-100 of 119 results. Next

A090014 Permanent of (0,1)-matrix of size n X (n+d) with d=4 and n-1 zeros not on a line.

Original entry on oeis.org

5, 25, 155, 1135, 9545, 90445, 952175, 11016595, 138864365, 1893369505, 27756952355, 435287980375, 7269934161905, 128812336516885, 2413131201408695, 47652865538001595, 989254278781162325
Offset: 1

Views

Author

Jaap Spies, Dec 13 2003

Keywords

References

  • Brualdi, Richard A. and Ryser, Herbert J., Combinatorial Matrix Theory, Cambridge NY (1991), Chapter 7.

Crossrefs

Programs

  • Mathematica
    f[x_] := x*HypergeometricPFQ[{1, 5}, {}, x/(x+1)]/(x+1); Total /@ Partition[ CoefficientList[ Series[f[x], {x, 0, 18}], x], 2, 1] // Rest (* Jean-François Alcover, Nov 12 2013, after A001909 and Mark van Hoeij *)
    t={5,25};Do[AppendTo[t,(n+3)*t[[-1]]+(n-2)*t[[-2]]],{n,3,17}];t (* Indranil Ghosh, Feb 21 2017 *)

Formula

a(n) = (n+3)*a(n-1) + (n-2)*a(n-2), a(1)=5, a(2)=25.
a(n) ~ exp(-1) * n! * n^4 / 24. - Vaclav Kotesovec, Nov 30 2017

Extensions

Corrected by Jaap Spies, Jan 26 2004

A116854 First differences of the rows in the triangle of A116853, starting with 0.

Original entry on oeis.org

1, 1, 1, 3, 1, 2, 11, 3, 4, 6, 53, 11, 14, 18, 24, 309, 53, 64, 78, 96, 120, 2119, 309, 362, 426, 504, 600, 720, 16687, 2119, 2428, 2790, 3216, 3720, 4320, 5040, 148329, 16687, 18806, 21234, 24024, 27240, 30960, 35280, 40320, 1468457, 148329, 165016, 183822, 205056, 229080, 256320, 287280, 322560, 362880
Offset: 1

Views

Author

Gary W. Adamson, Feb 24 2006

Keywords

Comments

Row n contains the first differences of row n of A116853, starting with T(n,1) = A116853(n,1) - 0.
As in A116853, 0! = 1 is omitted here. - Georg Fischer, Mar 23 2019

Examples

			First few rows of the triangle are:
[1]    1;
[2]    1,   1;
[3]    3,   1,   2;
[4]   11,   3,   4,   6;
[5]   53,  11,  14,  18,  24;
[6]  309,  53,  64,  78,  96, 120;
[7] 2119, 309, 362, 426, 504, 600, 720;
...
For example, row 4 (11, 3, 4, 6) are first differences along row 4 of A116853: ((0), 11, 14, 18, 24).
		

Crossrefs

Cf. A000142 (row sums), A033815 (central terms), A047920, A068106 (with 0!), A055790 (column k=3), A277609 (k=4), A277563 (k=5), A280425 (k=6).

Programs

  • Haskell
    a116854 n k = a116854_tabl !! (n-1) !! (k-1)
    a116854_row n = a116854_tabl !! (n-1)
    a116854_tabl = [1] : zipWith (:) (tail $ map head tss) tss
                   where tss = a116853_tabl
    -- Reinhard Zumkeller, Aug 31 2014
  • Maple
    A116853 := proc(n,k) option remember ; if n = k then n! ; else procname(n,k+1)-procname(n-1,k) ; end if; end proc:
    A116854 := proc(n,k) if k = 1 then A116853(n,1) ; else A116853(n,k) -A116853(n,k-1) ; end if; end proc:
    seq(seq(A116854(n,k),k=1..n),n=1..15) ; # R. J. Mathar, Mar 27 2010
  • Mathematica
    rows = 10;
    rr = Range[rows]!;
    dd = Table[Differences[rr, n], {n, 0, rows - 1}];
    T = Array[t, {rows, rows}];
    Do[Thread[Evaluate[Diagonal[T, -k+1]] = dd[[k, ;; rows-k+1]]], {k, rows}];
    Table[({0}~Join~Table[t[n, k], {k, 1, n}]) // Differences, {n, 1, rows}] // Flatten (* Jean-François Alcover, Dec 21 2019 *)

Formula

T(n,k) = A116853(n,k) - A116853(n,k-1) if k>1.
T(n,1) = A116853(n,1) = A000255(n-1).
Sum_{k=1..n} T(n,1) = n! = A000142(n).

Extensions

Definition made concrete and sequence extended by R. J. Mathar, Mar 27 2010

A180192 Triangle read by rows: T(n,k) is the number of permutations of [n] having k fixed blocks.

Original entry on oeis.org

1, 0, 1, 1, 1, 2, 4, 0, 9, 12, 3, 44, 57, 18, 1, 265, 321, 123, 11, 1854, 2176, 888, 120, 2, 14833, 17008, 7218, 1208, 53, 133496, 150505, 65460, 12550, 860, 9, 1334961, 1485465, 657690, 137970, 12405, 309, 14684570, 16170036, 7257240, 1623440
Offset: 0

Views

Author

Emeric Deutsch, Sep 08 2010

Keywords

Comments

A fixed block of a permutation p is a maximal sequence of consecutive fixed points of p. For example, the permutation 213458769 has 3 fixed blocks: 345, 7, and 9.
Row n has 1 + ceiling(n/2) entries.

Examples

			T(4,2)=3 because we have (1)4(3)2, (1)32(4), and 3(2)1(4) (the fixed blocks are shown between parentheses).
Triangle starts:
    1;
    0,   1;
    1,   1;
    2,   4,   0;
    9,  12,   3;
   44,  57,  18,   1;
  265, 321, 123,  11;
		

Crossrefs

T(n,0) = d(n) = A000166(n).
T(n,1) = A177265(n).
T(2n-1,n) = d(n-1).
T(2n,n) = d(n+1) + d(n) = A000255(n).
Sum of entries in row n is n! = A000142(n).
Cf. A001563.

Programs

  • Maple
    # yields sequence in triangular form:
    d[0] := 1: for n to 50 do d[n] := n*d[n-1] + (-1)^n od:
    T := (n, k) -> add(binomial(j-1, k-1)*binomial(n+1-j, k)*d[n-j], j = k .. n+1-k):
    for n from 0 to 11 do seq(T(n, k), k = 0..ceil((1/2)*n)) od;
  • Mathematica
    d = Subfactorial;
    T[n_, k_] := Sum[Binomial[j-1, k-1] Binomial[n-j+1, k] d[n-j] , {j, k, n-k+1}];
    Table[T[n, k], {n, 0, 11}, {k, 0, Ceiling[n/2]}] // Flatten (* Jean-François Alcover, Feb 16 2021 *)

Formula

T(n,k) = Sum_{j=k..n+1-k} binomial(j-1,k-1)*binomial(n+1-j,k)*d(n-j), where d(i) = A000166(i) are the derangement numbers.
The term binomial(j-1,k-1)*binomial(n+1-j,k)*d(n-j) in the above sum gives the number of permutations of [n] having k fixed blocks and a total number of j fixed points.
Sum_{k>=0} k*T(n,k) = (n-1)!*(n-1) = A001563(n-1).

A180193 Triangle read by rows: T(n,k) is the number of permutations of [n] having k blocks of odd length (0<=k<=n).

Original entry on oeis.org

1, 0, 1, 1, 0, 1, 0, 3, 0, 3, 2, 0, 11, 0, 11, 0, 14, 0, 53, 0, 53, 6, 0, 96, 0, 309, 0, 309, 0, 78, 0, 724, 0, 2119, 0, 2119, 24, 0, 852, 0, 6070, 0, 16687, 0, 16687, 0, 504, 0, 9300, 0, 56418, 0, 148329, 0, 148329, 120, 0, 8040, 0, 106170, 0, 577556, 0, 1468457, 0
Offset: 0

Views

Author

Emeric Deutsch, Sep 09 2010

Keywords

Comments

A block of a permutation is a maximal sequence of consecutive integers which appear in consecutive positions. For example, the permutation 5412367 has 4 blocks: 5, 4, 123, and 67.

Examples

			T(3,1)=3 because we have (123), 23(1), and (3)12 (the blocks of odd length are shown between parentheses). T(4,0)=2 because we have 1234 and 3412.
Triangle starts:
  1;
  0,1;
  1,0,1;
  0,3,0,3;
  2,0,11,0,11;
  0,14,0,53,0,53;
		

Crossrefs

Programs

  • Maple
    d[ -1] := 0: d[0] := 1: for n to 50 do d[n] := n*d[n-1]+(-1)^n end do: T := proc (n, k) if `mod`(n+k, 2) = 1 then 0 else sum(binomial(k+j, j)*binomial((1/2)*n+(1/2)*k-1, k+j-1)*(d[k+j]+d[k+j-1]), j = 0 .. (1/2)*n-(1/2)*k) end if end proc; for n from 0 to 10 do seq(T(n, k), k = 0 .. n) end do; # yields sequence in triangular form

Formula

T(n,k) = Sum(binomial(k+j,j)*binomial((n+k+2)/2,k+j-1)*[d(k+j)+d(k+j-1)], j=0..(n-k)/2) if n and k are of the same parity; T(n,k)=0 if n and k have opposite parities (0<=k<=n).
T(n,n) = T(n,n-2) = d(n)+d(n-1) = A000255(n-1), where d(i)=A000166(i) are the derangement numbers.
T(2n+1,1) = A001564(n).
Sum(k*T(n,k),k>=0) = A180195(n).
Sum of entries in row n = n! = A000142(n).

A180194 Triangle read by rows: T(n,k) is the number of permutations of [n] having k blocks of even length.

Original entry on oeis.org

1, 1, 1, 1, 4, 2, 13, 10, 1, 63, 48, 9, 356, 293, 68, 3, 2403, 2036, 557, 44, 18655, 16213, 4902, 539, 11, 163988, 145068, 47203, 6356, 265, 1608667, 1442858, 495710, 76833, 4679, 53, 17415725, 15792362, 5659377, 971992, 75490, 1854, 206202408
Offset: 0

Views

Author

Emeric Deutsch, Sep 09 2010

Keywords

Comments

A block of a permutation is a maximal sequence of consecutive integers which appear in consecutive positions. For example, the permutation 5412367 has 4 blocks: 5, 4, 123, and 67.
Number of entries in row n is 1+floor(n/2).

Examples

			T(3,1)=2 because we have (23)1 and 3(12) (the blocks of even length are shown between parentheses).
Triangle starts:
  1;
  1;
  1,1;
  4,2;
  13,10,1;
  63,48,9;
  356,293,68,3;
		

Crossrefs

Programs

  • Maple
    d[ -1] := 0: d[0] := 1: for n to 50 do d[n] := n*d[n-1]+(-1)^n end do: T := proc (n, k) if `mod`(n, 2) = 0 then sum(binomial(k+2*i, k)*binomial((1/2)*n+i-1, k+2*i-1)*(d[k+2*i]+d[k+2*i-1]), i = 0 .. (1/2)*n-k) else sum(binomial(k+2*i+1, k)*binomial((1/2)*n+i-1/2, k+2*i)*(d[k+2*i+1]+d[k+2*i]), i = 0 .. (1/2)*n-1/2-k) end if end proc: for n from 0 to 12 do seq(T(n, k), k = 0 .. floor((1/2)*n)) end do; # yields sequence in triangular form

Formula

T(n,k) = Sum(binomial(k+2i,k)*binomial(n/2+i-1,k+2i-1)*[d(k+2i)+d(k+2i-1)], i=0..n/2-k) if n is even,
T(n,k) = Sum(binomial(k+2i+1,k)*binomial(n/2-1/2+i,k+2i)*[d(k+2i+1)+d(k+2i)], i=0..n/2-1/2-k) if n is odd,
Here d(i)=A000166(i) are the derangement numbers.
Sum of entries in row n = n! = A000142(n).
T(2n,n) = d(n)+d(n-1) = A000255(n-1), where d(i)=A000166(n) are the derangement numbers.
T(2n+1,n) = d(n+2).
Sum(k*T(n,k), k>=0) = A180195(n-1).

A189285 Number of permutations p of 1,2,...,n satisfying p(i+6)-p(i)<>6 for all 1<=i<=n-6.

Original entry on oeis.org

1, 1, 2, 6, 24, 120, 720, 4920, 37488, 319644, 3033264, 31784280, 364902480, 4538652840, 61102571376, 885045657564, 13722397569072, 226742901078120, 3977354871110160, 73816786920489720, 1444940702597713008, 29750236302549282948
Offset: 0

Views

Author

Vaclav Kotesovec, Apr 19 2011

Keywords

Comments

a(n) is also number of ways to place n nonattacking pieces rook + semi-leaper[6,6] on an n X n chessboard.

Crossrefs

Formula

Asymptotics (V. Kotesovec, Mar 2011): a(n)/n! ~ (1 + 11/n + 30/n^2)/e.
Generally (for this sequence is d=6): 1/e*(1+(2d-1)/n+d*(d-1)/n^2).

Extensions

Terms a(23)-a(24) from Vaclav Kotesovec, Apr 21 2012

A321711 Triangle T(n,k) read by rows: coefficients of polynomials P_n(t) defined in Formula section.

Original entry on oeis.org

1, 1, 0, 3, 0, 0, 11, 9, 0, 1, 53, 120, 60, 40, 9, 309, 1410, 1800, 1590, 885, 216, 2119, 16560, 39960, 55120, 52065, 29016, 7570, 16687, 202755, 801780, 1696555, 2433165, 2300403, 1326850, 357435, 148329, 2624496, 15606360, 48387024, 99650670, 141429456, 135382464, 79738800, 22040361, 1468457, 36080100, 304274880, 1323453180, 3760709526, 7493549868, 10570597800, 10199809980, 6103007505, 1721632024
Offset: 0

Views

Author

Gheorghe Coserea, Nov 27 2018

Keywords

Examples

			For n=3 we have s1 = z1 + z2 + z3, s2 = z1^2 + z2^2 + z3^2, s12 = z1*z2 + z1*z3 + z2*z3, f1 = z1^2 + z2^2 + z3^2 + t*z2*z3 + z1*(z2 + z3), f2 = z1^2 + z2^2 + z3^2 + t*z1*z3 + z2*(z1 + z3), f3 = z1^2 + z2^2 + z3^2 + t*z1*z2 + z3*(z1 + z2), [(z1*z2*z3)^2] f1*f2*f3 = 11 + 9*t + t^3, therefore P_3(t) = 11 + 9*t + t^3.
A(x;t) = 1 + x + 3*x^2 + (11 + 9*t + t^3)*x^3 + (53 + 120*t + 60*t^2 + 40*t^3 + 9*t^4)*x^4 + ...
Triangle starts:
n\k [0]    [1]     [2]     [3]      [4]      [5]      [6]      [7]
[0] 1;
[1] 1;     0;
[2] 3;     0;      0;
[3] 11,    9,      0,      1;
[4] 53,    120,    60,     40,      9;
[5] 309,   1410,   1800,   1590,    885,     216;
[6] 2119,  16560,  39960,  55120,   52065,   29016,   7570;
[7] 16687, 202755, 801780, 1696555, 2433165, 2300403, 1326850, 357435;
[8] ...
		

Crossrefs

Programs

  • PARI
    P(n, t='t) = {
      my(z=vector(n, k, eval(Str("z", k))),
         s1=sum(k=1, #z, z[k]), s2=sum(k=1, #z, z[k]^2), s12=(s1^2 - s2)/2,
         f=vector(n, k, s2 + t*(s12 - z[k]*(s1 - z[k])) + z[k]*(s1 - z[k])), g=1);
      for (i=1, n, g *= f[i]; for(j=1, n, g=substpol(g, z[j]^3, 0)));
      for (k=1, n, g=polcoef(g, 2, z[k]));
      g;
    };
    seq(N) = concat([[1], [1, 0], [3, 0, 0]], apply(n->Vecrev(P(n,'t)), [3..N]));
    concat(seq(9))

Formula

Let z1..zn be n variables and s1 = Sum_{k=1..n} zk, s2 = Sum_{k=1..n} zk^2, s12 = (s1^2 - s2)/2, fk = s2 + t*(s12 - zk*(s1 - zk)) + zk*(s1 - zk) for k=1..n; we define P_n(t) = [(z1..zn)^2] Product_{k=1..n} fk.
A000255(n) = T(n,0).
A007107(n) = T(n,n).
A000681(n) = Sum_{k=0..n} T(n,k).
A274308(n) = Sum_{k=0..n} T(n,k)*2^k.

A337986 Prime numbers p such that v_p(A000166(k)) = v_p(k-1) for all k > 1, where v_p(k) is the p-adic valuation of k.

Original entry on oeis.org

2, 5, 7, 17, 19, 23, 29, 43, 59, 61, 71, 73, 107, 113, 131, 137, 149, 157, 173, 181, 191, 197, 199, 229, 233, 239, 241, 251, 257, 311, 317, 331, 349, 383, 401, 409, 421, 461, 491, 499, 541, 547, 557, 599, 601, 613, 619, 641, 653, 673, 719, 751, 761, 787, 797, 809
Offset: 1

Views

Author

Amiram Eldar, Jan 29 2021

Keywords

Comments

Miska (2016) proved that the complement of this sequence within the primes is infinite, and conjectured that this sequence is also infinite, and that its asymptotic density within the primes is 1/e (A068985). Numerically, he found that there are 28990 terms below 10^6, which are about 37% of all the primes less than 10^6.

Examples

			2 is a term since A007814(A000166(k)) = A007814(k-1) for all k > 1.
		

Crossrefs

Programs

  • Mathematica
    e[n_] := e[n] = Subfactorial[n]/(n - 1); q[p_] := PrimeQ[p] && AllTrue[Table[e[n], {n, 2, p + 1}], ! Divisible[#, p] &]; Select[Range[1000], q]

Formula

A prime p is a term if and only if p does not divide any of the numbers A000255(k), k in {2, ..., p+1}.

A344437 Regular triangle read by rows, T(n,k) is the number of derangements of [n] with exactly k right-to-left minima, for n >= 2 and 1 <= k <= n-1.

Original entry on oeis.org

1, 1, 1, 3, 5, 1, 11, 21, 11, 1, 53, 113, 79, 19, 1, 309, 715, 589, 211, 29, 1, 2119, 5235, 4835, 2141, 461, 41, 1, 16687, 43507, 43831, 22357, 6175, 883, 55, 1, 148329, 404699, 437079, 247549, 80531, 15161, 1541, 71, 1, 1468457, 4165965, 4765971, 2931193, 1074701, 242617, 33067, 2509, 89, 1
Offset: 2

Views

Author

Michel Marcus, May 19 2021

Keywords

Examples

			     1;
     1,    1;
     3,    5,    1;
    11,   21,   11,    1;
    53,  113,   79,   19,   1;
   309,  715,  589,  211,  29,  1;
  2119, 5235, 4835, 2141, 461, 41, 1;
  ...
		

Crossrefs

Row sums give A000166.
Cf. A000255 (column 1), A028387, A132393, A344455.

Formula

Sum_{k=1..n-1} k * T(n,k) = A344455(n). - Alois P. Heinz, May 19 2021

Extensions

More terms (rows 9-11) from Alois P. Heinz, May 19 2021

A345462 Triangle T(n,k) (n >= 1, 0 <= k <= n-1) read by rows: number of distinct permutations after k steps of the "first transposition" algorithm.

Original entry on oeis.org

1, 2, 1, 6, 3, 1, 24, 13, 4, 1, 120, 67, 23, 5, 1, 720, 411, 146, 36, 6, 1, 5040, 2921, 1067, 272, 52, 7, 1, 40320, 23633, 8800, 2311, 456, 71, 8, 1, 362880, 214551, 81055, 21723, 4419, 709, 93, 9, 1, 3628800, 2160343, 825382, 224650, 46654, 7720, 1042, 118, 10, 1
Offset: 1

Views

Author

Olivier Gérard, Jun 20 2021

Keywords

Comments

The first transposition algorithm is: if the permutation is sorted, then exit; otherwise, exchange the first unsorted letter with the letter currently at its index. Repeat.
At each step at least 1 letter (possibly 2) is sorted.
If one counts the steps necessary to reach the identity, this gives the Stirling numbers of the first kind (reversed).

Examples

			Triangle begins:
      1;
      2,     1;
      6,     3,    1;
     24,    13,    4,    1;
    120,    67,   23,    5,   1;
    720,   411,  146,   36,   6,  1;
   5040,  2921, 1067,  272,  52,  7, 1;
  40320, 23633, 8800, 2311, 456, 71, 8, 1;
  ...
		

References

  • D. E. Knuth, The Art of Computer Programming, Vol. 3 / Sorting and Searching, Addison-Wesley, 1973.

Crossrefs

Cf. A321352, A345461 (same idea for other sorting algorithms).
Cf. A180191 (second column, k=1).
Cf. A107111 a triangle with some common parts.
Cf. A143689 (diagonal T(n,n-3)).

Programs

  • Maple
    b:= proc(n, k) option remember; (k+1)!*
          binomial(n, k)*add((-1)^i/i!, i=0..k+1)/n
        end:
    T:= proc(n, k) option remember;
         `if`(k=0, n!, T(n, k-1)-b(n, n-k+1))
        end:
    seq(seq(T(n, k), k=0..n-1), n=1..10);  # Alois P. Heinz, Aug 11 2021
  • Mathematica
    b[n_, k_] := b[n, k] = (k+1)!*Binomial[n, k]*Sum[(-1)^i/i!, {i, 0, k+1}]/n;
    T[n_, k_] := T[n, k] = If[k == 0, n!, T[n, k-1] - b[n, n-k+1]];
    Table[Table[T[n, k], {k, 0, n - 1}], {n, 1, 10}] // Flatten (* Jean-François Alcover, Mar 06 2022, after Alois P. Heinz *)

Formula

T(n,0) = n!; T(n,n-3) = (3*(n-1)^2 - n + 3)/2.
From Alois P. Heinz, Aug 11 2021: (Start)
T(n,k) = T(n,k-1) - A010027(n,n-k) for k >= 1.
T(n,k) - T(n,k+1) = A123513(n,k).
T(n,0) - T(n,1) = A000255(n-1) for n >= 2.
T(n,1) - T(n,2) = A000166(n) for n >= 3.
T(n,2) - T(n,3) = A000274(n) for n >= 4.
T(n,3) - T(n,4) = A000313(n) for n >= 5. (End)
Previous Showing 91-100 of 119 results. Next