login
Number of distinct values taken by F(p) = Sum (|i-j| - |p(i)-p(j)|)^2 where the sum is over all 1 <= i < j <= n, for all permutations p in the symmetric group S_n.
1

%I #21 Sep 04 2024 15:52:20

%S 1,1,1,2,4,10,17,51,55,160,140,389,300,795,566,1290

%N Number of distinct values taken by F(p) = Sum (|i-j| - |p(i)-p(j)|)^2 where the sum is over all 1 <= i < j <= n, for all permutations p in the symmetric group S_n.

%C The function F was defined by Dan Asimov on the Mailing list Math-Fun on Aug. 18, 2024.

%p F:= S-> add(add((j-i-abs(S[j]-S[i]))^2, i=1..j-1), j=2..nops(S)):

%p a:= n-> nops({map(F, combinat[permute](n))[]}):

%p seq(a(n), n=0..10);

%Y Cf. A126972, A375623.

%K nonn,more

%O 0,4

%A _W. Edwin Clark_, Aug 21 2024

%E a(11)-a(13) from _Hugo Pfoertner_, Aug 24 2024

%E a(14)-a(15) from _Hugo Pfoertner_, Sep 04 2024