Function Repository Resource:

PartitionRank

Source Notebook

The largest part minus the number of parts of a partition

Contributed by: George Beck

ResourceFunction["PartitionRank"][x]

gives the difference of the largest part of the partition x and the number of parts of x.

Details and Options

A partition of a positive integer n is a weakly decreasing list of positive integers that add up to to n.
The rank is a partition statistic useful in studying congruence properties of the partition function p(n), given by PartitionsP in the Wolfram Language.

Examples

Basic Examples (2) 

The largest part is 4 and there are three parts, so the rank is 4-3=1:

In[1]:=
ResourceFunction["PartitionRank"][{4, 2, 2}]
Out[1]=

The largest part and the number of parts are both 5; 5-5=0:

In[2]:=
ResourceFunction["PartitionRank"][{5, 2, 1, 1, 1}]
Out[2]=

Neat Examples (2) 

Ramanujan discovered and proved analytically that the number of partitions of 5m+4 is divisible by 5:

In[3]:=
PartitionsP[Range[4, 44, 5]]
Out[3]=
In[4]:=
Mod[#, 5] == 0 & /@ %
Out[4]=

Dyson conjectured and Atkins-Swinnerton-Dyer proved that the partitions of a number of the form 5m+4 can be split into five sets of equal size according to the rank mod 5:

In[5]:=
Length /@ GatherBy[IntegerPartitions[9], Mod[ ResourceFunction["PartitionRank"]@#, 5] &]
Out[5]=

Here is another example:

In[6]:=
Length /@ GatherBy[IntegerPartitions[24], Mod[ ResourceFunction["PartitionRank"]@#, 5] &]
Out[6]=

A similar result holds for 7. In this case, the partitions of a number of the form 7m+5 can be split into seven sets of equal size, according to the rank mod 7:

In[7]:=
Length /@ GatherBy[IntegerPartitions[12], Mod[ ResourceFunction["PartitionRank"]@#, 7] &]
Out[7]=

Publisher

George Beck

Version History

  • 2.0.0 – 31 May 2019
  • 1.0.0 – 22 May 2019

Related Resources

License Information