# 14. Even More on Positive Divisors¶

The outline of the this notebook is as follows:

Today we will spend time looking at the functions which
counts the number of positive the divisors of and
which is the sum of positive divisors of . Our
goal is, once again, to use our minds, paper and pencil, and *SageMath*
to combine to not just conjecture, but start to give logical reasons for
our conjectures.

Definition: An arithmetic function is real or complex defined on the set of positive integers. That is . An arithmetic function is said to be multiplicative if it is not identically zero and if

Let and be positive integers and is an arithmetic function. If and then is said to be an multiplicative.

is said to be completely multiplicative if for all .

Knowing the definition of and what it means for an arithmetic function to be multiplicative, can we proof that and are both multiplicative function?

Let us first consider . To prove that is a multiplicative function, we must ask ourselves the following questions.

Is an arithmetic function?

Yes is an arithmetic function by definition. In particular, for all and since , it follows that is an arithmetic function.

For any two positive integers and with , is ?

We want to count the number of divisors of the product given that . From , we know that does not divide and vice-versa. Therefore, for a given divisor of say , the set divisors of the product will be multiplied by all the divisors of . That is, the set with cardinality . Repeating this for all the divisors of is exactly the product . This completes the proof.

How will you define in *SageMath*?

```
def tau(n):
r"""
Returns the number of divisors of $n$.
"""
return number_of_divisors(n)
```

```
tau(48)==tau(8)*tau(6)
```

```
False
```

Oops! What just happened? I thought we just proved that was multiplicative. What went wrong here?

Can you think of questions that we could explore on the number of divisors function ?

If is prime, what is ?

Is tau(sum of 2 perfect squares) even or odd?

What is if n is a perfect square. Is there a pattern?

Possible questions to guide us to obtain a general formular for the arithmetic function for any positive integer .

If is prime, what is the number of divisors of , ? Is there a general formula?

If and are prime, what is ?

If is prime, what is the number of divisors of for ? Is there a general formula for for all positive integer ?

Given a positive integer , is there a general formula for the number of divisors? Is there a general formula for ?

```
tau_of_prime_powers = lambda p, n : table([(p^k, tau(p^k) == k+1) for k in [0..n]], header_row=["$p^k$", r"$[\tau(p^k) = k+1]$"])
```

```
tau_of_prime_powers(3, 10)
```

```
prime_range(10)
```

```
[tau_of_prime_powers(p,10) for p in prime_range(10)]
```

Conjecture: If is prime then for all , . Let us work in groups to proof this now.

Proof:

We have a proof for our conjecture so it is now a theorem. But I will want to call it Lemma 1: If is prime, then for all , .

Now let we want to derive a general formula for for all positive integers. We know from the Fundamental Theorem of Arithmetic that:

Every positive integer can be written as a finite product of powers of distinct primes. That is,

Using this result and the multiplicative property of , we are able to derive a formula for given any positive integer .

How would you derive such a formula for given a positive integer ? Let be any positive integer. We want to derive a formula for . By the fundamental theorem of arithmetic

Then

Hence we have derived the general formula given any positive integer .

## 14.1. General Formulas¶

Here is the general hint to follow in order to get a general formula for these arithmetic functions.

Formula for or for primes

Formula for or for a power of a prime

General formula for or

Observe that these are the steps we followed to obtain a general formula for the number of divisors function .

In mathematics, a perfect square say is the product of some integer say with itself. That is, .

Investigate on the number of divisors of perfect squares using

*SageMath*.Observe your data very closely and try and come up with a conjecture on a pattern you think will always be true.

Proof your conjecture.

You are encouraged to work in groups.

Right now, try working on your own or in groups to try to prove the following conjectures.

For a perfect square is odd.

(For a full proof, you will probably need a reason why only certain numbers can divide other numbers.)

Now use the procedure we followed to derive a formula for to derive a formula for for any positive integer .

Let us recal the definition of . It is defined as follows: Given a positive , is the sum of all the positive divisors of .

Check if is

*multiplicative*, that is,If it is multiplicative, then try to prove it.

How will you define in *SageMath*?

```
def sigma(n):
"""
Returns the sum of the divisors of `n`
"""
pass
```

Can you formulate questions about the sum of positive divisors of , , that we could explore?

Write your questions here.

It turns out that sometimes it is also useful to have functions adding up just certain divisors. For instance, one could write a function for just the odd divisors, and for just the even divisors. Or you could define and to be the functions giving the number of divisors which are congruent to (mod ) and (mod ), respectively.

Try doing a few of these as well. You will likely want to recall how to use filtered list comprehensions, or “if/else” statements in a loop.

Naturally, I strongly encourage you to make interactive cells if this proves useful to you!

## 14.2. Exploring Divisors¶

Anyway, you should spend quite a bit of time today to try to find more patterns - or prove them! The kinds of questions here are somewhat different from those with partitions.

### 14.2.1. Modulo/Congruerence¶

It turns out that there are some pleasant patterns for when and are even and odd. I encourage you to explore and give arguments for what you find. Try to prove the conjectures that you come up with.

One could also investigate whether there are patterns when n is even or odd. What happens to ?

Write a program to demonstrate that if and only if the sums of the reciprocals of its (positive) divisors equals . Give an algebraic reason why this works.

Investigate the values for or modulo other primes . It would be interesting to see if there are any useful conjectures here.