%I #17 Jun 05 2021 08:43:33
%S 0,0,2,5,14,22,43,63,97,140,201,266,371,492,638,837,1079,1377,1748,
%T 2207,2756,3471,4287,5317,6537,8081,9840,12069,14643,17837,21543,
%U 26113,31385,37877,45318,54433,64944,77682,92341,109995,130373,154769,182866,216350,254905,300648,353259,415392,486843,570867
%N Sum of the 2nd smallest parts of all the partitions of n (2nd smallest part is defined to be 0 when the partition does not have at least 2 distinct parts).
%C a(n) = Sum_{k>=0} k*A265247(n,k).
%H Alois P. Heinz, <a href="/A265248/b265248.txt">Table of n, a(n) for n = 1..1000</a>
%F G.f.: G(x) = Sum_{i>=1} x^i/(1-x^i)*Sum_{j>=i+1} j*x^j/Product_{k>=j}(1-x^k).
%e a(4) = 5 because in [4], [3,1], [2,2], [2,1,1], [1,1,1,1] the 2nd smallest parts are 0,3,0,2,0, respectively.
%p g := add(x^i*add(j*x^j/mul(1-x^k, k = j .. 100), j = i+1 .. 100)/(1-x^i), i = 1 .. 100): gser := series(g, x = 0, 60): seq(coeff(gser, x, n), n = 1 .. 50);
%p # second Maple program:
%p b:= proc(n, i, t) option remember; `if`(n=0, [1, 0],
%p `if`(i>n, 0, add((p-> `if`(t=1, p+[0, i*p[1]], p))(
%p b(n-i*j, i+1, min(t+1,2))), j=1..n/i)+b(n, i+1, t)))
%p end:
%p a:= n-> b(n,1,0)[2]:
%p seq(a(n), n=1..50); # _Alois P. Heinz_, Dec 31 2015
%t Table[Total@ Flatten@ Map[Take[DeleteDuplicates@ #, {-2}] &, Select[IntegerPartitions@ n, Total@ Differences@ # != 0 && Length@ # >= 2 &]], {n, 50}] (* _Michael De Vlieger_, Dec 24 2015 *)
%t (* Second program: *)
%t b[n_, i_, t_] := b[n, i, t] = If[n == 0, {1, 0},
%t If[i > n, {0, 0}, Sum[If[t == 1, # + {0, i*#[[1]]}, #]&[
%t b[n - i*j, i+1, Min[t+1, 2]]], {j, 1, n/i}] + b[n, i+1, t]]];
%t a[n_] := b[n, 1, 0][[2]];
%t Array[a, 50] (* _Jean-François Alcover_, Jun 05 2021, after _Alois P. Heinz_ *)
%Y Cf. A265247.
%K nonn
%O 1,3
%A _Emeric Deutsch_, Dec 24 2015