Problem

Source: Romanian National Olympiad 2015, grade x, p.2

Tags: function, combinatorics, number theory, Divisibility



Consider a natural number $ n $ for which it exist a natural number $ k $ and $ k $ distinct primes so that $ n=p_1\cdot p_2\cdots p_k. $ a) Find the number of functions $ f:\{ 1, 2,\ldots , n\}\longrightarrow\{ 1,2,\ldots ,n\} $ that have the property that $ f(1)\cdot f(2)\cdots f\left( n \right) $ divides $ n. $ b) If $ n=6, $ find the number of functions $ f:\{ 1, 2,3,4,5,6\}\longrightarrow\{ 1,2,3,4,5,6\} $ that have the property that $ f(1)\cdot f(2)\cdot f(3)\cdot f(4)\cdot f(5)\cdot f(6) $ divides $ 36. $