Homepage › Solution manuals › Ivan Niven › An Introduction to the Theory of Numbers › Exercise 4.4.12 (Number of ways of writing $n$ in the form $n = m_1 + m_2 + \cdots + m_k$)
Exercise 4.4.12 (Number of ways of writing $n$ in the form $n = m_1 + m_2 + \cdots + m_k$)
Let be the number of ways of writing a positive integer in the form where and are arbitrary positive integers. Show that for . Deduce that for . Conclude that for all positive integers .
Answers
Note that here the order of is relevant (if not, we obtain the number of partitions of , which is another problem of Number Theory). So and are two distinct decompositions of .
Proof. Let be a positive integer. We search the cardinality of , where is the set of tuples such that .
Suppose that . Consider the sets of such tuples of positive integers satisfying . Since , we have , thus (disjoint union). So
If , there is a unique tuple satisfying the condition, so .
More generally, if , the cardinality of is equal to the number of tuples such that , where is arbitrary, thus
Therefore
So
Then for all ,
Therefore for . Note that , and , so for every ,
By induction, we obtain
Since ,
□
Note: Following the preceding algorithm to find , I give a recursive python program to obtain all decompositions of :
def decomposition(n): if n == 1: return [[1]] else: dec = [[n]] for i in range(1,n): for l in decomposition(n-i): dec.append([i] + l) return dec decomposition(5) [[5], [1, 4], [1, 1, 3], [1, 1, 1, 2], [1, 1, 1, 1, 1], [1, 1, 2, 1], [1, 2, 2], [1, 2, 1, 1], [1, 3, 1], [2, 3], [2, 1, 2], [2, 1, 1, 1], [2, 2, 1], [3, 2], [3, 1, 1], [4, 1]]