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.

A385366 a(n) = Sum_{permutations p of [n]} des(p^2), where des(p) is the number of descents of p.

Original entry on oeis.org

0, 0, 2, 24, 192, 1560, 13680, 131040, 1370880, 15603840, 192326400, 2554675200, 36404121600, 554204851200, 8979363993600, 154305575424000, 2803653844992000, 53708801642496000, 1082001156268032000, 22869278876860416000, 506043617700741120000, 11699825757321461760000
Offset: 1

Views

Author

Yifan Xie, Jun 26 2025

Keywords

Examples

			For the permutation p = (2, 3, 4, 1), p^2 = (3, 4, 1, 2), and des(p) = des(p^2) = 1 (because 4 > 1).
		

Crossrefs

Cf. A001286.

Programs

  • Mathematica
    A385366[n_] := If[n <= 2, 0, (n - 1)!*(n^2 - n - 4)/2];
    Array[A385366, 25] (* Paolo Xausa, Jul 14 2025 *)
  • PARI
    a(n)=if(n>2,(n-1)!*(n^2-n-4)/2, 0);

Formula

a(n) = 0 if n <= 2; a(n) = (n-1)!*(n^2-n-4)/2 if n >= 3.