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-4 of 4 results.

A363181 Number of permutations p of [n] such that for each i in [n] we have: (i>1) and |p(i)-p(i-1)| = 1 or (i

Original entry on oeis.org

1, 0, 2, 2, 8, 14, 54, 128, 498, 1426, 5736, 18814, 78886, 287296, 1258018, 4986402, 22789000, 96966318, 461790998, 2088374592, 10343408786, 49343711666, 253644381032, 1268995609502, 6756470362374, 35285321738624, 194220286045506, 1054759508543554
Offset: 0

Views

Author

Alois P. Heinz, May 19 2023

Keywords

Comments

Number of permutations p of [n] such that each element in p has at least one neighbor whose value is smaller or larger by one.
Number of permutations of [n] having n occurrences of the 1-box pattern.

Examples

			a(0) = 1: (), the empty permutation.
a(1) = 0.
a(2) = 2: 12, 21.
a(3) = 2: 123, 321.
a(4) = 8: 1234, 1243, 2134, 2143, 3412, 3421, 4312, 4321.
a(5) = 14: 12345, 12354, 12543, 21345, 21543, 32145, 32154, 34512, 34521, 45123, 45321, 54123, 54312, 54321.
a(6) = 54: 123456, 123465, 123654, 124356, 124365, 125634, 125643, 126534, 126543, 213456, 213465, 214356, 214365, 215634, 215643, 216534, 216543, 321456, 321654, 341256, 341265, 342156, 342165, 345612, 345621, 346512, 346521, 431256, 431265, 432156, 432165, 435612, 435621, 436512, 436521, 456123, 456321, 561234, 561243, 562134, 562143, 563412, 563421, 564312, 564321, 651234, 651243, 652134, 652143, 653412, 653421, 654123, 654312, 654321.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<4, [1, 0, 2$2][n+1],
          3/2*a(n-1)+(n-3/2)*a(n-2)-(n-5/2)*a(n-3)+(n-4)*a(n-4))
        end:
    seq(a(n), n=0..30);

Formula

a(n) = A346462(n,n).
a(n)/2 mod 2 = A011655(n-1) for n>=1.
a(n) ~ sqrt(Pi) * n^((n+1)/2) / (2 * exp(n/2 - sqrt(n)/2 + 7/16)) * (1 - 119/(192*sqrt(n))). - Vaclav Kotesovec, May 26 2023

A263690 Number of length n arrays of permutations of 0..n-1 with each element moved by -n to n places and every three consecutive elements having its maximum within 3 of its minimum.

Original entry on oeis.org

1, 1, 2, 6, 24, 36, 36, 48, 80, 128, 200, 288, 432, 648, 992, 1496, 2272, 3424, 5192, 7840, 11880, 17952, 27184, 41096, 62208, 94072, 142368, 215328, 325832, 492864, 745736, 1128096, 1706800, 2582024, 3906464, 5909784, 8941024, 13526368, 20464072, 30959200
Offset: 0

Views

Author

R. H. Hardin, Oct 23 2015

Keywords

Crossrefs

Diagonal of A263693.
Cf. A333833.

Formula

Empirical: a(n) = a(n-1) +a(n-2) -a(n-3) +a(n-4) for n>12.
G.f.: (8*x^12+8*x^11-4*x^10-8*x^8+6*x^7+20*x^6-7*x^5-16*x^4-4*x^3-1) / (x^4-x^3+x^2+x-1). - Alois P. Heinz, Apr 08 2020

Extensions

a(0), a(24)-a(39) from Alois P. Heinz, Apr 08 2020

A263696 Number of length n arrays of permutations of 0..n-1 with each element moved by -n to n places and every three consecutive elements having its maximum within 4 of its minimum.

Original entry on oeis.org

1, 1, 2, 6, 24, 120, 288, 456, 768, 1508, 3434, 7560, 16024, 31872, 61704, 122464, 246296, 500506, 1015010, 2041372, 4098824, 8224718, 16535378, 33298104, 67036986, 134932118, 271438490, 545959366, 1098340012, 2209778140
Offset: 0

Views

Author

R. H. Hardin, Oct 24 2015

Keywords

Examples

			Some solutions for n=7
..3....4....4....6....0....0....4....0....4....0....0....6....1....2....1....1
..0....6....0....5....3....1....3....2....0....1....4....5....0....6....0....3
..2....2....1....4....1....2....6....1....3....3....1....4....3....5....3....0
..1....5....2....2....4....4....5....4....1....2....3....2....4....4....4....2
..4....1....5....0....2....6....2....5....5....5....5....0....5....3....6....4
..5....3....6....3....5....3....1....3....2....6....2....1....2....1....2....6
..6....0....3....1....6....5....0....6....6....4....6....3....6....0....5....5
		

Crossrefs

Diagonal of A263703.
Cf. A333833.

Extensions

a(0), a(23)-a(29) from Alois P. Heinz, Apr 08 2020

A338614 Number of permutations p of [n] such that |p(i) - p(i-1)| <= 3 and |p(i) - p(i-2)| <= 4.

Original entry on oeis.org

1, 1, 2, 6, 24, 72, 124, 210, 394, 810, 1652, 3168, 5816, 10640, 19794, 37292, 70298, 131618, 245146, 456430, 851670, 1592008, 2976326, 5559808, 10379010, 19374184, 36175422, 67562524, 126185322, 235650426, 440038528
Offset: 0

Views

Author

Alois P. Heinz, Nov 03 2020

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(s, x, y) option remember; `if`(s={}, 1, add(
          `if`((x=0 or abs(x-j)<=4) and (y=0 or abs(y-j)<=3),
              b(s minus {j}, y, j), 0), j=s))
        end:
    a:= n-> b({$1..n}, 0$2):
    seq(a(n), n=0..20);
Showing 1-4 of 4 results.