# 11. Even More on Pieces of Numbers¶

In yesterday’s lecture, we looked at the number of integer partitions of an positive integer . A parition of is defined as a representation of 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:

The number of partitions of with even parts. This is notated .

The number of partitions of with odd parts. This is notated .

The number of partitions of with repeated parts. This is notated .

The number of partitions of with distinct parts; that is, all the numbers in the partition are different. This is notated .

*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 . For example we can create a domain for all the partitions of an integer say, .

```
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 by doing the following

```
all_partitions_of_eight.list()
```

List all partitions of .

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 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,
. I want to know all the partitions of with distinct
parts.

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

Do same for partitions of .

How about if I want to list all partitions of 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 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 with old parts are there?

With `min_length=k`

, I can get those partitions that have at least
parts. Let’s list all partitions of with at least
parts and compute its cardinality.

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

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

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

We can also list all the partitions of with parts that are at
least with `min_part=k`

. That is, those partitions of
whose parts are all greater than or equal to .

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

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

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

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

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

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

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

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

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

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

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

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:

The number of partitions of with prime parts. This is notated .

The number of partitions of with parts whose product is equal to . This is notated .

The number of partitions of with at least odd part. This is notated .

The number of partitions of with at least even part. This is notated .

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

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

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

Given that is a perfect square, say for some integer . Is there a relation between the number of partitions of and the number of partitions of ?

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

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]
```