A209536 Number of partitions of 0 having positive part-sum <= n.
1, 5, 14, 39, 88, 209, 434, 918, 1818, 3582, 6718, 12647, 22848, 41073, 72049, 125410, 213619, 361844, 601944, 995073, 1622337, 2626341, 4201366, 6681991, 10515755, 16449851, 25509951, 39333475, 60172700, 91577516, 138390480, 208096281, 310976730, 462512830
Offset: 1
Keywords
Examples
0 = 1-1 = 2-2 = 2-(1+1) = (1+1)-2 = (1+1)-(1+1), so that a(2) = 5.
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..5000
Programs
-
Maple
a:= proc(n) option remember; `if`(n=0, 0, combinat[numbpart](n)^2+a(n-1)) end: seq(a(n), n=1..40); # Alois P. Heinz, Oct 21 2018
-
Mathematica
p[n_] := IntegerPartitions[n]; l[n_] := Length[p[n]]; s[n_] := Sum[l[k]^2, {k, 1, n}]; Table[s[n], {n, 1, 40}] (* A209536 *) (* Second program: *) a[n_] := a[n] = If[n == 0, 0, PartitionsP[n]^2 + a[n-1]]; Array[a, 40] (* Jean-François Alcover, Jun 09 2021, after Alois P. Heinz *)
Formula
From Alois P. Heinz, Oct 21 2018: (Start)
a(n) = Sum_{j=1..n} A000041(j)^2.
a(n) = -1 + A259399(n). (End)
Comments