Max/Min Sums From Permutations

Robert G. Wilson v rgwv at rgwv.com
Sat Jan 29 21:31:49 CET 2005


Dear Leroy,

	Obviously that coding did not work, this is better but slower.


f[lst_] := Block[{l = Length[lst]}, Sum[ lst[[i]]*lst[[i + 1]], {i, l - 1}]]
g[n_] := Block[{lst = Permutations[Table[i, {i, n}]]}, t = (f /@ lst); {Max[t], 
Min[t]}]
Table[ g[n][[1]], {n, 10}]


{0, 2, 9, 23, 46, 80, 127, 189, 268, 366}
{0, 2, 5, 12, 22, 38,  59,  88, 124, 170}


	Then I read my email, particularly your email with Joshua Zucher's comments.

f[lst_] := Sum[ lst[[i]]*lst[[i + 1]], {i, Length[lst] - 1}];

fmine[n_] := Flatten[ Join[ Table[{n - i + 1, i}, {i, 1, n/2, 2}],
       Table[{n - i + 1, i}, {i, n/2 + If[ EvenQ[n/2], 1, 2], n - 1, 2}]]];

fmino1[n_] := Flatten[Join[Table[{n - i + 1, i}, {i, 1, n/2, 2}], {n/2 + 1/2},
       Table[{n - i + 1, i}, {i, n/2 + 3/2, n - 1, 2}]]];

fmino2[n_] := Delete[ Flatten[ Join[Table[{n - i + 1, i}, {i, 1, n/2, 2}],
         Table[{n - i + 1, i}, {i, n/2 + 1/2, n - 1, 2}]]], (n + 3)/2];

fmino[n_] := If[EvenQ[(n + 1)/2], fmino2[n], fmino1[n]];

fmin[n_] := If[ EvenQ[n], f[ fmine[n]], f[ fmino[n]]];

t = Table[ fmin[n], {n, 1001}];

c = CoefficientList[Series[(2 - x + x^2)x/((1 + x)(1 - x)^4), {x, 0, 1000}], x];

t == c

This test results in "True". Therefore at least as to the conjecture that the
sequence for the minimums and A026035 being equal is correct for the first
one thousand terms. The coding is not elegant but it does work.

Bob.



Rainer Rosenthal wrote:

>>Joshua Zucker has asked me to pass on his message to me:
> 
> 
>>0 2 5 12 22 38 59 88 124 170 225 292 370 462 567 688 824 978 1149
>>1340 1550 1782 2035 2312 2612 2938 3289 3668 4074 4510 4975 5472 6000
>>6562 7157 7788 8454 9158 9899 10680 11500 12362 13265 14212 15202
>>16238 17319 18448 19624 20850
>>(is that enough terms?)
> 
> 
> Hi Leroy,
> 
> congratulations for your pretty sequence ideas!
> And it seems as if Joshua's terms are enough to
> convince naive people like me that this sequence
> of product-mins is the same as 
> http://www.research.att.com/projects/OEIS?Anum=A026035
> 
> Ralf Stephan made some corrections to this sequence
> some days ago and may be he will be so kind and
> add the terms 17319 18448 19624 20850, as well as
> a comment relating to your and Joshuas findings.
> 
> This was very entertaining!
> Thanks again to Neil, who prepared this lovely
> playground OEIS and takes care for it all the time.
> 
> Thanks,
> Rainer Rosenthal
> r.rosenthal at web.de
> 





More information about the SeqFan mailing list