Basic Examples (2)
Basic Examples
(2)
Here is an illustrative example. Start with the integer partitions of 3:
In[76]:=
IntegerPartitions@3
Out[76]=
{{3},{2,1},{1,1,1}}
Here are their smallest parts:
In[77]:=
Min/@IntegerPartitions@3
Out[77]=
{3,1,1}
Compute the number of smallest parts per partition:
In[78]:=
Count[#,Min[#]]&/@IntegerPartitions@3
Out[78]=
{1,1,3}
Find their total:
In[67]:=
Total@%
Out[67]=
5
This is precisely the value returned by :
SmallestPartsFunction
Out[62]=
5
———
Out[68]=
{1,3,5,10,14,26,35,57,80,119}
Neat Examples (3)
Neat Examples
(3)