login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A200067 Maximum sum of all products of absolute differences and distances between element pairs among the integer partitions of n. 3
0, 0, 0, 1, 3, 6, 12, 20, 30, 45, 63, 84, 112, 144, 180, 225, 275, 330, 396, 468, 546, 637, 735, 840, 960, 1088, 1224, 1377, 1539, 1710, 1900, 2100, 2310, 2541, 2783, 3036, 3312, 3600, 3900, 4225, 4563, 4914, 5292, 5684, 6090, 6525, 6975, 7440, 7936, 8448 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,5

COMMENTS

Also the maximum sum of weighted inversions among the compositions of n where weights are products of absolute differences and distances between the element pairs which are not in sorted order.

a(n) is divisible by at least one triangular number >1 for n>=4. Thus 3 is the only prime in this sequence.

LINKS

Alois P. Heinz, Table of n, a(n) for n = 0..1000

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

FORMULA

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

a(n) = max_{k=0..n} (n-k-1)*k*(k+1)/2.

a(n) = (n-k-1)*k*(k+1)/2 with k = max(0, floor((2*n-1)/3)), or k = A004396(n-1) for n>0.

EXAMPLE

a(2) =  0: [1,1]-> 0, [2]-> 0; the maximum is 0.

a(3) =  1: [1,1,1]-> 0, [2,1]-> 1, [3]-> 0; the maximum is 1.

a(4) =  3: [1,1,1,1]-> 0, [2,1,1]-> 1+2 = 3, [2,2]->0, [3,1]->2, [4]->0.

a(5) =  6: [2,1,1,1]-> 1+2+3 = 6, [3,1,1]-> 2 + 2*2 = 2*(1+2) = 6.

a(6) = 12: [3,1,1,1]-> 2 + 2*2 + 2*3 = 2*(1+2+3) = 12.

a(7) = 20: [3,1,1,1,1]-> 2 + 2*2 + 2*3 + 2*4 = 2*(1+2+3+4) = 20.

a(8) = 30: [3,1,1,1,1,1]-> 2*(1+2+3+4+5) = 30, [4,1,1,1,1]-> 3*(1+2+3+4) = 30.

MAPLE

a:= proc(n) local k; k:= max(0, floor((2*n-1)/3)); (n-k-1)*k*(k+1)/2 end: seq(a(n), n=0..50);

MATHEMATICA

a[n_] := Max[Table[(n-k-1)*k*(k+1)/2, {k, 0, n}]]; Table[a[n], {n, 0, 50}] (* Jean-Fran├žois Alcover, Nov 22 2013, after Alois P. Heinz *)

CROSSREFS

Cf. A000217, A004396, A200068.

Sequence in context: A320608 A246147 A066140 * A061061 A001975 A096220

Adjacent sequences:  A200064 A200065 A200066 * A200068 A200069 A200070

KEYWORD

nonn,easy

AUTHOR

Alois P. Heinz, Nov 13 2011

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 February 28 23:19 EST 2020. Contains 332353 sequences. (Running on oeis4.)