A101986 Maximum sum of products of successive pairs in a permutation of order n+1.
0, 2, 9, 23, 46, 80, 127, 189, 268, 366, 485, 627, 794, 988, 1211, 1465, 1752, 2074, 2433, 2831, 3270, 3752, 4279, 4853, 5476, 6150, 6877, 7659, 8498, 9396, 10355, 11377, 12464, 13618, 14841, 16135, 17502, 18944, 20463, 22061, 23740, 25502
Offset: 0
Examples
The permutations of order 5 with maximum sum of products is 1 3 5 4 2 and its reverse, since (1*3)+(3*5)+(5*4)+(4*2) is 46. All others are empirically less than 46. So a(4) = 46.
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 0..1000
- Leroy Quet, Max/Min Sums From Permutations - a message on Jan 28 2005 to the sequence list, asking for someone to provide more values and to submit these to OEIS.
- Index entries for linear recurrences with constant coefficients, signature (4,-6,4,-1).
Programs
-
Haskell
a101986 n = sum $ zipWith (*) [1,3..] (reverse [2..n+1]) -- Reinhard Zumkeller, Mar 30 2012
-
J
0 1 9 2 & p. % 6 & p. (A) NB. the polynomial P such that P(n) is a(n). NB. where 0 1 9 2 are the coefficients in ascending order of the numerator of a rational polynomial and 6 is the (constant) coefficient of its denominator. J's primitive function p. produces a polynomial with these coefficients. Division is indicated by % . Thus the J expression (A) is equivalent to the formula above.
-
Maple
a:=n->add((n+j^2),j=1..n): seq(a(n),n=0..41); # Zerinvary Lajos, Jul 27 2006
-
Mathematica
Table[(n + 9 n^2 + 2 n^3)/6, {n, 0, 41}] (* Robert G. Wilson v, Feb 04 2005 *)
-
PARI
a(n)=n*(2*n^2+9*n+1)/6 \\ Charles R Greathouse IV, Jan 17 2012
Formula
a(n) = n*(2*n^2 + 9*n + 1)/6.
G.f.: x*(1+x)*(2-x)/(1-x)^4. - L. Edson Jeffery, Jan 17 2012
a(n) = 4*a(n-1)-6*a(n-2)+4*a(n-3)-a(n-4) for n>3, a(0)=0, a(1)=2, a(2)=9, a(3)=23. - L. Edson Jeffery, Jan 17 2012
a(n) = 1 + sum( A008865(i), i=1..n+1 ). [Bruno Berselli, Jan 13 2015]
Extensions
Edited by Bruno Berselli, Jan 13 2015
Name edited by Alois P. Heinz, Feb 02 2019
Comments