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.

A373691 Triangle read by rows T(n, k) is the number of permutations on n elements whose square has k descents, for n >= 1 and 0 <= k <= n-1.

Original entry on oeis.org

1, 2, 0, 4, 2, 0, 10, 6, 6, 2, 26, 22, 48, 22, 2, 76, 68, 276, 260, 40, 0, 232, 214, 1384, 2204, 944, 62, 0, 764, 672, 6240, 16172, 13212, 3048, 200, 12, 2620, 2204, 27096, 103588, 145160, 70740, 10936, 524, 12, 9496, 7354, 113722, 612178, 1338370, 1145614, 364366, 36838, 862, 0
Offset: 1

Views

Author

Michel Marcus, Jun 14 2024

Keywords

Examples

			Triangle begins:
    1;
    2,   0;
    4,   2,    0;
   10,   6,    6,    2;
   26,  22,   48,   22,   2;
   76,  68,  276,  260,  40,  0;
  232, 214, 1384, 2204, 944, 62, 0;
  ...
		

Crossrefs

Cf. A000085 (1st column), A000142 (row sums), A037224 (right diagonal).
Cf. A003483 (square permutations), A008292.

Programs

  • PARI
    sq(p) = vector(#p, k, p[p[k]]);
    nbd(p) = sum(i=1, #p-1, p[i+1] < p[i]);
    row(n) = my(v=vector(n)); for (i=1, n!, v[nbd(sq(numtoperm(n, i)))+1]++;); v;