To solve the problem of finding the number of onto functions \( f \) from the set \( \{1, 2, 3, \ldots, 20\} \) to itself such that \( f(k) \) is a multiple of 3 whenever \( k \) is a multiple of 4, we can follow these steps:
### Step 1: Identify the multiples of 4
The multiples of 4 in the set \( \{1, 2, 3, \ldots, 20\} \) are:
\[ 4, 8, 12, 16, 20 \]
This gives us a total of 5 elements.
### Step 2: Identify the multiples of 3
The multiples of 3 in the set \( \{1, 2, 3, \ldots, 20\} \) are:
\[ 3, 6, 9, 12, 15, 18 \]
This gives us a total of 6 elements.
### Step 3: Mapping the multiples of 4 to multiples of 3
Since \( f(k) \) must be a multiple of 3 whenever \( k \) is a multiple of 4, we need to map the 5 multiples of 4 to the 6 multiples of 3.
### Step 4: Count the onto functions
To ensure that the function is onto, we can use the principle of counting onto functions. The number of onto functions from a set of \( m \) elements to a set of \( n \) elements can be calculated using the formula:
\[
n! \cdot S(m, n)
\]
where \( S(m, n) \) is the Stirling number of the second kind, representing the number of ways to partition \( m \) objects into \( n \) non-empty subsets.
In our case, we need to find the number of onto functions from the 5 multiples of 4 to the 6 multiples of 3. However, since we have more multiples of 3 than multiples of 4, we can directly map the 5 multiples of 4 to 5 of the 6 multiples of 3.
### Step 5: Calculate the number of ways to map
1. Choose 5 multiples of 3 from the 6 available. This can be done in \( \binom{6}{5} = 6 \) ways.
2. The 5 multiples of 4 can be mapped to the selected 5 multiples of 3 in \( 5! \) (factorial of 5) ways.
Thus, the total number of ways to map the multiples of 4 to the multiples of 3 is:
\[
6 \cdot 5! = 6 \cdot 120 = 720
\]
### Step 6: Map the remaining elements
Now, we have 15 remaining elements in the domain (since we have already used 5 elements) and 15 remaining elements in the codomain (since we have used 5 of the 6 multiples of 3). The remaining 15 elements can be mapped in \( 15! \) ways.
### Step 7: Combine the results
The total number of onto functions \( f \) is given by:
\[
720 \cdot 15!
\]
### Final Answer
Thus, the total number of functions \( f \) from \( \{1, 2, 3, \ldots, 20\} \) onto \( \{1, 2, 3, \ldots, 20\} \) such that \( f(k) \) is a multiple of 3 whenever \( k \) is a multiple of 4 is:
\[
15! \cdot 6!
\]