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 A319536 #18 Feb 26 2020 08:15:12 %S A319536 0,2,14,122,1278,15802,225886,3670074,66843902,1349399162,29912161758, %T A319536 722399486074,18881553923326,531063524702778,15993786127174238, %U A319536 513533806880120762,17512128958240460286,632099987274779910394,24076353238897830158302 %N A319536 Number of signed permutations of length n where numbers occur in consecutive order. %C A319536 a(n) also represents the number of reducible signed permutations of length n. A permutation is reducible when an adjacency occurs in the permutation. %C A319536 The first 8 terms of this sequence were found by exhaustive search of all signed permutations. %D A319536 Manaswinee Bezbaruah, Henry Fessler, Leigh Foster, Marion Scheepers, George Spahn, Context Directed Sorting: Robustness and Complexity, draft. %H A319536 Leigh Foster, <a href="/A319536/b319536.txt">Table of n, a(n) for n = 1..50</a> %F A319536 a(n) = A000165(n) - A271212(n). %e A319536 Of the 8 signed permutations of length 2: {[1,2], [-1,2], [1,-2], [-1,-2], [2,1], [-2,1], [2,-1], [-2,-1]} only two are reducible: [1,2] and [-2,-1]. Thus a(2) = 2. %t A319536 Table[(2 n)!!, {n, 1, 20}] - RecurrenceTable[{a[n]==(2n-1)*a[n-1]+2(n-2)*a[n-2], a[0]==1, a[1]==2}, a[n], {n, 1, 20}] %o A319536 (SageMath) %o A319536 from ast import literal_eval %o A319536 def checkFunc(n): %o A319536 p = SignedPermutations(n) %o A319536 permlist = p.list() %o A319536 permset = set(permlist) %o A319536 for perm in permlist: %o A319536 perm_literal = literal_eval(str(perm)) %o A319536 for i in range(n-1): %o A319536 a = perm_literal[i] %o A319536 if perm_literal[i + 1] == a + 1: %o A319536 permset.remove(perm) %o A319536 break %o A319536 print(factorial(n)*(2^n)-len(permset)) %o A319536 # usage: checkFunc({desired permutation length}) %Y A319536 Cf. A000165, A271212. %K A319536 nonn %O A319536 1,2 %A A319536 _Leigh Foster_, Sep 22 2018