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.

A007972 Number of permutations that are 2 "block reversals" away from 12...n.

Original entry on oeis.org

2, 15, 52, 129, 266, 487, 820, 1297, 1954, 2831, 3972, 5425, 7242, 9479, 12196, 15457, 19330, 23887, 29204, 35361, 42442, 50535, 59732, 70129, 81826, 94927, 109540, 125777, 143754, 163591, 185412, 209345, 235522, 264079, 295156, 328897, 365450, 404967, 447604
Offset: 3

Views

Author

Keywords

Crossrefs

Column k=2 of A300003.

Programs

  • Mathematica
    a[n_] := Block[{s, allb, r = Flatten[Table[{i, j}, {i, n}, {j, i + 1, n}], 1]}, allb[pp_] := Union@ Table[ s=pp; s[[Range @@ e]] = Reverse[ s[[ Range @@ e]]]; s, {e, r}]; Length[Flatten[allb /@ allb[Range[n]], 1] // Union] - 1]; a /@ Range[3,15] (* Giovanni Resta, Jun 08 2015 *)

Formula

a(n) = (n^4+6*n^3+11*n^2-12*n+6)/6 (conjectured). - Giovanni Resta, Jun 08 2015
Conjectured g.f.: (-2-5x+3x^2+x^3-x^4)/(-1+x)^5. - Benedict W. J. Irwin, Feb 20 2016
a(n) = A228396(n) - A000124(n-1). See C. Homberger links from A228396. This proves the above conjectured formulas up to offset. - Martin Fuller, Mar 31 2025

Extensions

a(9)-a(41) from Giovanni Resta, Jun 08 2015
Edited by Martin Fuller, Mar 31 2025