OFFSET
1,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..1000
EXAMPLE
For n = 6 the partitions of 6 are
6
5 + 1
4 + 2
4 + 1 + 1
3 + 3
3 + (2) + 1 .... the "2" is the part that does not count.
3 + 1 + 1 + 1
2 + 2 + 2
2 + 2 + 1 + 1
2 + 1 + 1 + 1 + 1
1 + 1 + 1 + 1 + 1 + 1
The total number of parts in all partitions of 6 is equal to 35. All parts are the smallest part or the largest part, except the "2" in the partition (3 + 2 + 1), so a(6) = 35 - 1 = 34.
MAPLE
l:= proc(n, i) option remember; `if`(n=i, n, 0)+
`if`(i<1, 0, l(n, i-1) +`if`(n<i, 0, l(n-i, i)))
end:
s:= proc(n, i) option remember; `if`(n=0 or i=1, n,
`if`(irem(n, i, 'r')=0, r, 0)+add(s(n-i*j, i-1), j=0..n/i))
end:
a:= n-> l(n, n) +s(n, n) -numtheory[sigma](n):
seq(a(n), n=1..50); # Alois P. Heinz, Jan 17 2013
MATHEMATICA
l[n_, i_] := l[n, i] = If[n==i, n, 0] + If[i<1, 0, l[n, i-1] + If[n<i, 0, l[n-i, i]]]; s[n_, i_] := s[n, i] = If[n==0 || i==1, n, {q, r} = QuotientRemainder[n, i]; If[r==0, q, 0] + Sum[s[n-i*j, i-1], {j, 0, n/i}] ]; a[n_] := l[n, n] + s[n, n] - DivisorSigma[1, n]; Table[a[n], {n, 1, 50}] (* Jean-François Alcover, Nov 03 2015, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Omar E. Pol, Jul 17 2011
EXTENSIONS
a(12) corrected and more terms a(13)-a(40) from David Scambler, Jul 18 2011
STATUS
approved