[go: up one dir, main page]

login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A375623 Maximum value of 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. 0
0, 0, 0, 2, 12, 30, 72, 132, 240, 380, 600, 870, 1260, 1722 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,4
COMMENTS
The function F was defined by Dan Asimov on the Mailing list Math-Fun on Aug. 18, 2024. It can be considered as a sort of entropy of a permutation p like the function Sum_{k=1..n} (p(k)-k)^2 in A126972.
The terms for even n seem to agree with A047928.
LINKS
MAPLE
F := proc(S) local i, j, M;
M := 0;
for j from 1 to nops(S) do
for i from 1 to j-1 do
M := M + (abs(i - j) - abs(S[i] - S[j]))^2
od:
od: M end:
a := proc(n) local P, m, u, mm;
P := combinat:-permute(n);
m := 0;
for u in P do
mm := F(u);
if mm > m then m := mm fi;
od: m end:
PROG
(PARI) a375623(n) = my(m=0); forperm(n, p, m=max(m, sum(i=1, n, sum(j=1, i-1, (abs(i-j)-abs(p[i]-p[j]))^2)))); m \\ Hugo Pfoertner, Aug 22 2024
CROSSREFS
Sequence in context: A127118 A259127 A296257 * A301774 A286230 A083175
KEYWORD
nonn,more,new
AUTHOR
W. Edwin Clark, Aug 21 2024
EXTENSIONS
a(11)-a(13) from Hugo Pfoertner, Aug 23 2024
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 31 19:21 EDT 2024. Contains 375573 sequences. (Running on oeis4.)