%I #22 May 23 2018 07:21:29
%S 0,0,1,3,8,14,27,42,67,101,149,210,301,416,565,770,1030,1368,1800,
%T 2357,3055,3962,5068,6485,8232,10444,13125,16506,20600,25701,31865,
%U 39483,48644,59906,73375,89846,109515,133379,161784,196078,236801,285720,343623,412866,494624,591991,706623,842625
%N The difference between the two largest distinct parts of a partition (0 if no distinct parts), summed over all partitions of n.
%H Vaclav Kotesovec, <a href="/A268191/b268191.txt">Table of n, a(n) for n = 1..1932</a> (terms 1..1000 from Alois P. Heinz)
%F a(n) = Sum_{k>0} k*A268190(n,k).
%F G.f.: g = Sum_{i>1} (Sum_{j = 1..i-1} ((i-j)*x^{i+j}/((1-x^i) * Product_{k=1..j} (1 - x^k)))).
%e a(5) = 8 because the partitions [5], [4,1], [3,2], [3,1,1], [2,2,1], [2,1,1,1], and [1,1,1,1,1] of 5 contribute 0, 3, 1, 2, 1, 1, and 0, respectively.
%p g := add(add((i-j)*x^(i+j)/((1-x^i)*mul(1-x^k, k = 1 .. j)), j = 1 .. i-1), i = 2 .. 80): gser := series(g, x = 0, 55): seq(coeff(gser, x, n), n = 1 .. 50);
%p # second Maple program:
%p b:= proc(n, l, i) option remember; `if`(irem(n, i)=0,
%p `if`(l=0, 0, i-l), 0) +`if`(i>n, 0, add(b(n-i*j,
%p `if`(j=0, l, i), i+1), j=0..(n-1)/i))
%p end:
%p a:= n-> b(n, 0, 1):
%p seq(a(n), n=1..50); # _Alois P. Heinz_, Feb 11 2016
%t b[n_, l_, i_] := b[n, l, i] = If[Mod[n, i] == 0, If[l == 0, 0, i-l], 0] + If[i>n, 0, Sum[b[n-i*j, If[j == 0, l, i], i+1], {j, 0, (n-1)/i}]]; a[n_] := b[n, 0, 1]; Table[a[n], {n, 1, 50}] (* _Jean-François Alcover_, Dec 21 2016, after _Alois P. Heinz_ *)
%Y Cf. A268190.
%K nonn
%O 1,4
%A _Emeric Deutsch_, Feb 10 2016