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.

A127697 Number of permutations of {1,2,...,n} where adjacent elements differ in value by 3 or more.

Original entry on oeis.org

1, 1, 0, 0, 0, 0, 2, 32, 368, 3984, 44304, 521606, 6564318, 88422296, 1272704694, 19521035238, 318120059458, 5491779703870, 100150978723568, 1924351621839740, 38864316540425434, 823161467837784388
Offset: 0

Views

Author

Richard Forster (gbrl01(AT)yahoo.co.uk), Apr 11 2007, Apr 26 2007

Keywords

Comments

Equivalently, number of permutations of {1,2,...,n} where elements that differ by 1 in value are neither in positions i and i+1 (adjacent), nor i and i+2.

Examples

			Valid permutations of {1,...,6} are 415263 and 362514.
		

Crossrefs

Cf. A002464 (stride >= 2), A179957 (stride >= 4), A179958 (stride >=5).

Programs

  • Mathematica
    Clear[permCount]; permCount[s_, last_] := permCount[s, last] = Module[{n, j}, n = Length[s]; If[n == 0, 1, Total[Table[If[Abs[last - j] >= 3, permCount[DeleteCases[s, j], j], 0], {j, s}]]]]; Table[permCount[Range[n], -2], {n, 0, 12}] (* Robert P. P. McKone, Mar 01 2025 *)

Extensions

Jul 01 2010: Zak Seidov corrected a(10) and a(11). R. H. Hardin then computed a(12) through a(18).
Corrected first term to 1 (was 0).
a(0), a(19)-a(20) from Alois P. Heinz, Oct 27 2014
a(21) from Alois P. Heinz, Feb 09 2025

A249392 The number of down-up permutations of [n] where adjacent elements differ by at least 5.

Original entry on oeis.org

1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 32, 1088, 17280, 293832, 4004352, 57687080, 773838336, 10900027949, 151388845568, 2200665880514, 32321771402240, 495575856116168, 7760560549644288, 126552637539515688
Offset: 0

Views

Author

R. J. Mathar, Oct 27 2014

Keywords

Crossrefs

Cf. A245377 (at least 2), A249390 (at least 3), A249391 (at least 4), A249393 (at least 6), A179958 (non-alternating)

Extensions

a(17)-a(21) from Alois P. Heinz, Oct 27 2014
a(22)-a(24) from Max Alekseyev, Feb 24 2024

A322308 Number of permutations sigma such that |sigma(i+j)-sigma(i)| >= 5 for 1 <= i <= n - j, 1 <= j <= 4.

Original entry on oeis.org

1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 128, 6320, 344872
Offset: 0

Views

Author

Seiichi Manyama, Dec 03 2018

Keywords

Comments

2 | a(n) for n > 1.

Examples

			a(25) = 2: [5,10,15,20,25,4,9,14,19,24,3,8,13,18,23,2,7,12,17,22,1,6,11,16,21] and its reverse.
		

Crossrefs

Showing 1-3 of 3 results.