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.
%I A180564 #20 Sep 19 2024 07:23:22 %S A180564 1,0,1,1,2,3,7,14,35,81,216,557,1583,4444,13389,40313,128110,409519, %T A180564 1366479,4603338,16064047,56708713,206238116,759535545,2870002519, %U A180564 10986716984,43019064953,170663829777,690840124506,2832976091771,11831091960887,50040503185030 %N A180564 Number of permutations of [n] having no isolated entries. An entry j of a permutation p is isolated if it is not preceded by j-1 and not followed by j+1. For example, the permutation 23178564 has 2 isolated entries: 1 and 4. %C A180564 a(n) = A180196(n,0). %C A180564 a(n) = n! - A184181(n). %H A180564 Alois P. Heinz, <a href="/A180564/b180564.txt">Table of n, a(n) for n = 0..893</a> %F A180564 a(n) = Sum_{j=1..floor(n/2)} binomial(n-j-1, j-1)*(d(j) + d(j-1)), where d(i) = A000166(i) are the derangement numbers; a(0)=1. %e A180564 a(5)=3 because we have 12345, 34512, and 45123. %p A180564 d[ -1] := 0: d[0] := 1: for n to 50 do d[n] := n*d[n-1]+(-1)^n end do: a := proc (n) options operator, arrow: sum(binomial(n-j-1, j-1)*(d[j]+d[j-1]), j = 1 .. floor((1/2)*n)) end proc:a(0):=1: seq(a(n), n = 0 .. 32); %p A180564 # second Maple program: %p A180564 a:= proc(n) option remember; `if`(n<4, [1, 0, 1, 1][n+1], %p A180564 (3*a(n-1)+(n-3)*a(n-2)-(n-3)*a(n-3)+(n-4)*a(n-4))/2) %p A180564 end: %p A180564 seq(a(n), n=0..31); # _Alois P. Heinz_, Feb 17 2024 %t A180564 a[n_] := If[n == 0, 1, With[{d = Subfactorial}, Sum[Binomial[n-j-1, j-1]* (d[j] + d[j-1]), {j, 1, Floor[n/2]}]]]; %t A180564 Table[a[n], {n, 0, 31}] (* _Jean-François Alcover_, Sep 17 2024 *) %Y A180564 Cf. A000142, A000166, A180196, A184181. %K A180564 nonn %O A180564 0,5 %A A180564 _Emeric Deutsch_, Sep 09 2010 %E A180564 a(0)=1 prepended by _Alois P. Heinz_, Feb 17 2024