cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A211881 Difference between sum of largest parts and sum of smallest parts of all partitions of n into an even number of parts.

This page as a plain text file.
%I A211881 #13 Feb 15 2017 07:55:19
%S A211881 0,0,0,1,2,5,9,16,26,41,65,95,142,202,293,403,568,766,1054,1399,1886,
%T A211881 2469,3276,4237,5538,7094,9162,11628,14856,18704,23670,29590,37130,
%U A211881 46109,57428,70885,87685,107634,132324,161595,197545,240091,291990,353302,427624
%N A211881 Difference between sum of largest parts and sum of smallest parts of all partitions of n into an even number of parts.
%H A211881 Alois P. Heinz, <a href="/A211881/b211881.txt">Table of n, a(n) for n = 0..1000</a>
%F A211881 a(n) = A222048(n) - A222045(n).
%F A211881 a(n) = A116686(n) - A211870(n).
%e A211881 a(6) = 9: partitions of 6 into an even number of parts are [1,1,1,1,1,1], [2,2,1,1], [3,1,1,1], [3,3], [4,2], [5,1], difference between sum of largest parts and sum of smallest parts is (1+2+3+3+4+5) - (1+1+1+3+2+1) = 18 - 9 = 9.
%p A211881 g:= proc(n, i) option remember; [`if`(n=i, n, 0), 0]+
%p A211881       `if`(i>n, [0, 0], g(n, i+1)+(l-> [l[2], l[1]])(g(n-i, i)))
%p A211881     end:
%p A211881 b:= proc(n, i) option remember;
%p A211881       [`if`(n=i, n, 0), 0]+`if`(i<1, [0, 0], b(n, i-1)+
%p A211881        `if`(n<i, [0, 0], (l-> [l[2], l[1]])(b(n-i, i))))
%p A211881     end:
%p A211881 a:= n-> g(n, 1)[2] -b(n, n)[2]:
%p A211881 seq(a(n), n=0..50);
%t A211881 g[n_, i_] := g[n, i] = {If[n==i, n, 0], 0} + If[i>n, {0, 0}, g[n, i+1] + Reverse[g[n-i, i]]]; b[n_, i_] := b[n, i] = {If[n==i, n, 0], 0} + If[i<1, {0, 0}, b[n, i-1] + If[n<i, {0, 0}, Reverse[b[n-i, i]]]]; a[n_] := g[n, 1][[2]] - b[n, n][[2]]; Table[a[n], {n, 0, 50}] (* _Jean-François Alcover_, Feb 15 2017, translated from Maple *)
%Y A211881 Cf. A116686, A211870, A222045, A222048.
%K A211881 nonn
%O A211881 0,5
%A A211881 _Alois P. Heinz_, Feb 13 2013