To solve the problem, we need to find the number of matrices \( B \) such that \( AB = BA \), where \( A = \begin{pmatrix} 2 & 3 \\ 5 & 7 \end{pmatrix} \) and \( B = \begin{pmatrix} a & 0 \\ 0 & b \end{pmatrix} \) with \( a, b \in \mathbb{N} \).
### Step 1: Calculate \( AB \)
We start by calculating the product \( AB \):
\[
AB = \begin{pmatrix} 2 & 3 \\ 5 & 7 \end{pmatrix} \begin{pmatrix} a & 0 \\ 0 & b \end{pmatrix}
\]
Calculating the elements:
- First row, first column: \( 2a + 3 \cdot 0 = 2a \)
- First row, second column: \( 2 \cdot 0 + 3b = 3b \)
- Second row, first column: \( 5a + 7 \cdot 0 = 5a \)
- Second row, second column: \( 5 \cdot 0 + 7b = 7b \)
Thus, we have:
\[
AB = \begin{pmatrix} 2a & 3b \\ 5a & 7b \end{pmatrix}
\]
### Step 2: Calculate \( BA \)
Next, we calculate the product \( BA \):
\[
BA = \begin{pmatrix} a & 0 \\ 0 & b \end{pmatrix} \begin{pmatrix} 2 & 3 \\ 5 & 7 \end{pmatrix}
\]
Calculating the elements:
- First row, first column: \( a \cdot 2 + 0 \cdot 5 = 2a \)
- First row, second column: \( a \cdot 3 + 0 \cdot 7 = 3a \)
- Second row, first column: \( 0 \cdot 2 + b \cdot 5 = 5b \)
- Second row, second column: \( 0 \cdot 3 + b \cdot 7 = 7b \)
Thus, we have:
\[
BA = \begin{pmatrix} 2a & 3a \\ 5b & 7b \end{pmatrix}
\]
### Step 3: Set \( AB = BA \)
Now, we set the two products equal to each other:
\[
\begin{pmatrix} 2a & 3b \\ 5a & 7b \end{pmatrix} = \begin{pmatrix} 2a & 3a \\ 5b & 7b \end{pmatrix}
\]
From this, we can equate the corresponding elements:
1. \( 2a = 2a \) (This is always true)
2. \( 3b = 3a \)
3. \( 5a = 5b \)
4. \( 7b = 7b \) (This is always true)
### Step 4: Solve the equations
From the equations \( 3b = 3a \) and \( 5a = 5b \), we can simplify them:
- From \( 3b = 3a \), we get \( b = a \).
- From \( 5a = 5b \), we also get \( a = b \).
Thus, we conclude that \( a = b \).
### Step 5: Determine the number of matrices \( B \)
Since \( a \) and \( b \) are both natural numbers and they must be equal, we can choose any natural number for \( a \) (and thus for \( b \)). Therefore, the number of matrices \( B \) such that \( AB = BA \) is infinite, as \( a \) can take any natural number value.
### Final Answer
The number of matrices \( B \) such that \( AB = BA \) is infinite.
---