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.

A211870 Difference between sum of largest parts and sum of smallest parts of all partitions of n into an odd number of parts.

This page as a plain text file.
%I A211870 #16 Feb 16 2017 02:44:09
%S A211870 0,0,0,0,1,3,6,13,22,38,58,93,134,202,282,405,554,774,1035,1412,1862,
%T A211870 2489,3243,4267,5496,7137,9106,11684,14782,18782,23575,29689,37010,
%U A211870 46238,57275,71048,87489,107844,132083,161853,197243,240418,291619,353702,427167
%N A211870 Difference between sum of largest parts and sum of smallest parts of all partitions of n into an odd number of parts.
%H A211870 Alois P. Heinz, <a href="/A211870/b211870.txt">Table of n, a(n) for n = 0..1000</a>
%F A211870 a(n) = A222047(n) - A222044(n).
%F A211870 a(n) = A116686(n) - A211881(n).
%e A211870 a(6) = 6: partitions of 6 into an odd number of parts are [2,1,1,1,1], [2,2,2], [3,2,1], [4,1,1], [6], difference between sum of largest parts and sum of smallest parts is (2+2+3+4+6) - (1+2+1+1+6) = 17 - 11 = 6.
%p A211870 g:= proc(n, i) option remember; [`if`(n=i, n, 0), 0]+
%p A211870       `if`(i>n, [0, 0], g(n, i+1)+(l-> [l[2], l[1]])(g(n-i, i)))
%p A211870     end:
%p A211870 b:= proc(n, i) option remember;
%p A211870       [`if`(n=i, n, 0), 0]+`if`(i<1, [0, 0], b(n, i-1)+
%p A211870        `if`(n<i, [0, 0], (l-> [l[2], l[1]])(b(n-i, i))))
%p A211870     end:
%p A211870 a:= n-> g(n, 1)[1] -b(n, n)[1]:
%p A211870 seq(a(n), n=0..50);
%t A211870 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][[1]] - b[n, n][[1]]; Table[a[n], {n, 0, 50}] (* _Jean-François Alcover_, Feb 16 2017, translated from Maple *)
%Y A211870 Cf. A116686, A211881, A222044, A222047.
%K A211870 nonn
%O A211870 0,6
%A A211870 _Alois P. Heinz_, Feb 12 2013