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.

Showing 1-3 of 3 results.

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

A007975 Number of permutations that are 3 "block reversals" away from 12...n.

Original entry on oeis.org

2, 55, 389, 1563, 4642, 11407, 24600, 48204, 87758, 150707, 246787, 388445, 591294, 874603, 1261822, 1781142, 2466090, 3356159, 4497473, 5943487, 7755722, 10004535, 12769924, 16142368, 20223702, 25128027, 30982655, 37929089, 46124038, 55740467, 66968682, 80017450, 95115154, 112510983, 132476157, 155305187, 181317170
Offset: 4

Views

Author

Keywords

Crossrefs

Column k=3 of A300003.

Formula

a(n) = A228397(n) - A228396(n). See C. Homberger links from A228396. - Martin Fuller, Mar 31 2025

Extensions

More terms from Sean A. Irvine, Feb 22 2018
a(34) onwards from Martin Fuller, Mar 31 2025

A228397 The number of permutations of length n sortable by 3 reversals.

Original entry on oeis.org

1, 2, 6, 24, 118, 534, 1851, 5158, 12264, 25943, 50214, 90656, 154758, 252304, 395793, 600894, 886936, 1277433, 1800644, 2490168, 3385574, 4533066, 5986183, 7806534, 10064568, 12840379, 16224546, 20319008, 25237974, 31108868, 38073309, 46288126, 55926408
Offset: 1

Views

Author

Vincent Vatter, Aug 21 2013

Keywords

Examples

			There are 2 permutations of length 5 which cannot be sorted by 3 reversals.
		

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[(1/x) (-1 - (2 x^10 + 5 x^9 + 12 x^8 - 75 x^7 + 58 x^6 + 20 x^5 + 24 x^4 - 22 x^3 + 16 x^2 - 6 x + 1)/(x - 1)^7), {x, 0, 50}], x] (* Bruno Berselli, Aug 22 2013 *)

Formula

G.f.: -1 -(2*x^10 + 5*x^9 + 12*x^8 - 75*x^7 + 58*x^6 + 20*x^5 + 24*x^4 - 22*x^3 + 16*x^2 - 6*x + 1)/(x - 1)^7.
a(n) = n! for 0 < n < 4; for n > 3, a(n) = 318 + n*(7*n^5 -21*n^4 -125*n^3 -819*n^2 +12862*n -42720)/144. [Bruno Berselli, Aug 22 2013]
Showing 1-3 of 3 results.