login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A306262 Difference between maximum and minimum sum of products of successive pairs in permutations of [n]. 1
0, 0, 0, 4, 11, 24, 42, 68, 101, 144, 196, 260, 335, 424, 526, 644, 777, 928, 1096, 1284, 1491, 1720, 1970, 2244, 2541, 2864, 3212, 3588, 3991, 4424, 4886, 5380, 5905, 6464, 7056, 7684, 8347, 9048, 9786, 10564, 11381, 12240, 13140, 14084, 15071, 16104, 17182 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,4

LINKS

Colin Barker, Table of n, a(n) for n = 0..1000

Index entries for linear recurrences with constant coefficients, signature (3,-2,-2,3,-1).

FORMULA

a(n+1) = a(n) + 1/4*((-1+(-1)^(n-1))^2+2*(n-1)*(n+4)) with a(n) = 0 for n <= 2.

From Alois P. Heinz, Feb 01 2019: (Start)

G.f.: -(x^2+x-4)*x^3/((x+1)*(x-1)^4).

a(n) = (2*n^3+6*n^2-26*n+15-3*(-1)^n)/12 for n > 0.

a(n) = A101986(n-1) - A026035(n) for n > 0. (End)

EXAMPLE

a(4) = 11 = 23 - 12. 1342 and 2431 have sums 23, 3214 and 4123 have sums 12.

MAPLE

a:= n-> `if`(n=0, 0, (<<0|1|0|0|0>, <0|0|1|0|0>, <0|0|0|1|0>,

    <0|0|0|0|1>, <-1|3|-2|-2|3>>^n. <<1, 0, 0, 4, 11>>)[1, 1]):

seq(a(n), n=0..50);  # Alois P. Heinz, Feb 02 2019

MATHEMATICA

a[n_] := Module[

  {min, max, perm, g, mperm},

  perm = Permutations[Range[n]];

  g[x_] := Sum[x[[i]] x[[i + 1]], {i, 1, Length[x] - 1}];

  mperm = Map[g, perm];

  min = Min[mperm];

  max = Max[mperm];

  Return[max - min]]

PROG

(PARI) concat([0, 0, 0], Vec(x^3*(4 - x - x^2) / ((1 - x)^4*(1 + x)) + O(x^40))) \\ Colin Barker, Feb 05 2019

CROSSREFS

Cf. A026035, A101986.

Sequence in context: A301045 A008090 A008250 * A099074 A014818 A328684

Adjacent sequences:  A306259 A306260 A306261 * A306263 A306264 A306265

KEYWORD

nonn

AUTHOR

Louis Rogliano, Feb 01 2019

EXTENSIONS

More terms from Alois P. Heinz, Feb 01 2019

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified November 13 02:59 EST 2019. Contains 329085 sequences. (Running on oeis4.)