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.

A075851 Number of permutations s of {1,2,...,n} such that |s(i)-i|>2 for each i=1,2,...,n.

This page as a plain text file.
%I A075851 #21 Oct 30 2022 18:19:59
%S A075851 1,0,0,0,0,0,1,8,112,1168,13365,159414,2036488,27780408,404351752,
%T A075851 6263006598,102946702825,1790795492176,32880327473840,635630231970048,
%U A075851 12907624693811937,274744151265431700,6117666413618771968,142238172767973342656
%N A075851 Number of permutations s of {1,2,...,n} such that |s(i)-i|>2 for each i=1,2,...,n.
%C A075851 a(n) equals the permanent of the n X n matrix with 0's along the main diagonal, the superdiagonal, the subdiagonal, the sub-subdiagonal, the super-superdiagonal, and 1's everywhere else. - _John M. Campbell_, Jul 09 2011
%H A075851 Alois P. Heinz, <a href="/A075851/b075851.txt">Table of n, a(n) for n = 0..450</a>
%p A075851 b:= proc(s) option remember; (n-> `if`(n=0, 1, add(
%p A075851       `if`(abs(n-i)>2, b(s minus {i}), 0), i=s)))(nops(s))
%p A075851     end:
%p A075851 a:= n-> b({$1..n}):
%p A075851 seq(a(n), n=0..15);  # _Alois P. Heinz_, Jan 25 2019
%t A075851 a[0] = 1; a[n_] := a[n] = If[n<6, 0, SparseArray[{Band[{1, 1}] -> 0, Band[{2, 1}] -> 0, Band[{3, 1}] -> 0, Band[{1, 2}] -> 0, Band[{1, 3}] -> 0}, {n, n}, 1] // Permanent];
%t A075851 Table[Print[n, " ", a[n]]; a[n], {n, 0, 23}] (* _Jean-François Alcover_, Apr 30 2019 *)
%Y A075851 Cf. A001883, A075852.
%K A075851 nonn
%O A075851 0,8
%A A075851 _Reiner Martin_, Oct 15 2002
%E A075851 More terms from _Vladimir Baltic_, _Vladeta Jovovic_, Jan 04 2003
%E A075851 a(21) from _Alois P. Heinz_, Jul 04 2015
%E A075851 a(22)-a(23) from _Alois P. Heinz_, Jan 22 2019
%E A075851 a(0)=1 prepended by _Alois P. Heinz_, Jan 25 2019