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 A329851 #23 Jun 05 2024 01:25:13 %S A329851 0,2,12,120,1320,17856,273056,4772624,92626944,1986317024,46556867456, %T A329851 1184827221584,32524270418432,958020105786536 %N A329851 Sum of absolute values of n-th differences over all permutations of {0, 1, ..., n}. %C A329851 a(n) <= ((n+1)! - 2*A131502(n))*A130783(n). %C A329851 Every term is even because the n-th difference of a permutation and its reversal are the same up to sign. %e A329851 For n = 2, the second differences of the (2+1)! = 6 permutations of {0,1,2} are: %e A329851 [0,1,2] -> [1, 1] -> 0, %e A329851 [0,2,1] -> [2,-1] -> -3, %e A329851 [1,0,2] -> [-1, 2] -> 3, %e A329851 [1,2,0] -> [1,-2] -> -3, %e A329851 [2,0,1] -> [-2, 1] -> 3, and %e A329851 [2,1,0] -> [-1,-1] -> 0. %e A329851 The sum of the absolute values of these second differences is 0 + 3 + 3 + 3 + 3 + 0 = 12. %t A329851 a[n_] := Block[{x, k}, k = CoefficientList[(x - 1)^n, x]; Sum[Abs[k.p], {p, Permutations@ Range[0, n]}]]; Array[a, 10, 0] (* _Giovanni Resta_, Nov 23 2019 *) %o A329851 (Python) %o A329851 from math import comb %o A329851 from itertools import permutations %o A329851 def A329851(n): %o A329851 c = [-comb(n,i) if i&1 else comb(n,i) for i in range(n+1)] %o A329851 return sum(abs(sum(c[i]*p[i] for i in range(n+1))) for p in permutations(range(n+1)) if p[0]<p[-1])<<1 # _Chai Wah Wu_, Jun 04 2024 %Y A329851 Cf. A130783, A131502, A327845. %K A329851 nonn,more %O A329851 0,2 %A A329851 _Peter Kagey_, Nov 22 2019 %E A329851 a(10) from _Alois P. Heinz_, Nov 22 2019 %E A329851 a(11)-a(13) from _Giovanni Resta_, Nov 23 2019