11. Even More on Pieces of Numbers

In yesterday’s lecture, we looked at the number of integer partitions p(n) of an positive integer n. A parition of n is defined as a representation of n as a sum of positive integers, called summands or parts of the partition. The order of the summands is irrelevant. We then came up with posed the following statements and questions:

  1. The number of partitions of n with even parts. This is notated p(n\,|\,\text{even parts}).

  2. The number of partitions of n with odd parts. This is notated p(n\,|\,\text{odd parts}).

  3. The number of partitions of n with repeated parts. This is notated p(n\,|\,\text{repeated parts}).

  4. The number of partitions of n with distinct parts;  that is, all the numbers in the partition are different. This is notated p(n\,|\,\text{distinct parts}).

SageMath has built-in capabilities to compute partitions.  There are two classes for integer partitions in Sage; namely Partition and Partitions. The former takes a list of non-increasing list of integers which represent a partition of a given integer as argument whiles the later takes a positive integer. We will be working with the Partitions class. But let us take a look at the difference between these two classes.

The class Partition with a list non-increasing integers as an it argument, instantiates a fixed partition object with the given input list. For example:

Partition?
fixed_partition_obj = Partition([3,2,1,1,1]); fixed_partition_obj

But the class Partitions with an integer as its argument instantiates a domain containing all the partitions of n. For example we can create a domain for all the partitions of an integer say, 8.

all_partitions_of_eight = Partitions(8); all_partitions_of_eight

Do you remember what all_partitions_of_eight is? Let us remind ourselves if we have forgotten.

all_partitions_of_eight

Can you create all partitions of 5?

With the list method, I can list all the partitions of 8 by doing the following

all_partitions_of_eight.list()

List all partitions of 5.

Spend some time reading the SageMath documention on Partitions. Get familiar with the syntax and read the remaining part of the notebook.

Partitions?

Using max_slope=-1 I can produce all partitions of an n into distinct parts; that is, each part differs from the next by at least 1. Use a different max_slope to get parts that differ by, say, 2. I want to know all the partitions of 8 with distinct parts.

list(Partitions(8, max_slope = -1))

Do same for partitions of 5.

How about if I want to list all partitions of n with either odd or even parts? I can do that with the parts_in option.

list(Partitions(8, parts_in = [2,4..8])) # all partitions of eight with even parts

List all the partitions of 5 with odd parts.

With the cardinality method I can compute the number of such partitions.

Partitions(8, parts_in = [2,4..8]).cardinality()

How many partitions of 5 with old parts are there?

With min_length=k, I can get those partitions that have at least k parts. Let’s list all partitions of 8 with at least 4 parts and compute its cardinality.

Partitions(8, min_length=4).list()
len(Partitions(8, min_length=4).list())

List all the partitions of 5 with at least 2 parts and compute its cardinality.

We can also list all the partitions of n with parts that are at least k with min_part=k. That is, those partitions of n whose parts are all greater than or equal to k.

Let’s list all the partitions of 8 with parts that are at least 3 and find its cardinality.

Partitions(8, min_part=3).list()
Partitions(8, min_part=3).cardinality()

List all the partitions of 5 with parts that are at least 2 and find its cardinality.

What if I want the number of partitions of n with exactly k parts? We can do this with the length option. For example, let us find the number of partitions of 8 with exactly 3 parts and list them.

Partitions(8, length=3).cardinality()
Partitions(8, length=3).list()

Now find the number of partitions of 5 with exactly 3 parts and list them.

We can even combine all these options. Say for example we want to list all the partitions of 10 with exactly 3 parts such that these parts are at least 2.

Partitions(10, min_part=2, length=3).list()

List all the partitions of 15 with exactly 4 parts such that these parts are at least 5.

Now let us use these tools to explore if we can find some relation between the some of the statements we made and if possible make some conjectures and try to prove them. In your explorations try to use all the tools in programming you have been equipped with. Some more questions we could ask are:

  1. The number of partitions of n with prime parts. This is notated p(n\,|\,\text{prime parts}).

  2. The number of partitions of n with parts whose product is equal to n. This is notated p(n\,|\,\text{product of parts is } n).

  3. The number of partitions of n with at least 1 odd part. This is notated p(n\,|\,\text{at least one odd part}).

  4. The number of partitions of n with at least 1 even part. This is notated p(n\,|\,\text{at least one even part}).

  5. The number of partitions of n given that n is an Armstrong number. (See for the definition of an Armstrong number).

  6. Is there a distribution for the number of partitions of n? If so find such a distribution.

  7. Is there a formula for computing the number of partitions of n? If so find it.

  8. Given that p is a perfect square, say p=n^{2} for some integer n. Is there a relation between the number of partitions of p and the number of partitions of n?

  9. The number of 1’s in each a partition of n.

Our goal today is to explore some of them and see if there is an relation between them or some underlying hidden structure that can be observed and studied.

For each of the question above, is there a geometric interpretation?

Can you think of any more question one ould ask? Kindly list three of them and explore. See if you can derive a conjecture and prove it. You do not have to come up with a complete proof of your conjecture, but we are interested in the way you came about it and how you intend to prove it.

11.1. Bijective Proof

[1, 2, 3, 5, 7, 11, 15, 22, 30, 42]