p1. For what values of $a$ is $(5 a + 1)(3a + 2)$ divisible by $15$?


p2. Of the four-digit positive integers that are multiple of $9$, how many are there that have all their digits different from zero and different from each other?


p3. A square with side $5$ is divided into $25$ unit squares by lines parallel to the sides. Let A be the set of the $16$ interior points, which are vertices of the unit squares, but which are not on the sides of the initial square. What is the largest number of points in $A$ that can be chosen so that any three of them not vertices of a right isosceles triangle?


p4. In a parallelogram $ABCD$, $BC = 2AB$. The bisector of angle $B$ intersects the extension of segment $CD$ at $Q$ and the bisector of angle $A$ intersects segment $BD$ at $M$ and segment $BC$ at $P$. If $PQ = 6$,  find the length of the segment $MB$.


p5. Find the number of ways to write nonnegative integers in each box on a board of dimension $ n \times n$,  so that the sum of the numbers in each row and each column is equal to $3$ and in each row and in each column there are only one or two numbers different from zero.
### Problem 1:
For what values of \( a \) is \( (5a + 1)(3a + 2) \) divisible by \( 15 \)?

1. For \( (5a + 1)(3a + 2) \) to be divisible by \( 15 \), it must be divisible by both \( 3 \) and \( 5 \).
2. First, consider divisibility by \( 3 \):
   \[
   5a + 1 \equiv 0 \pmod{3} \quad \text{or} \quad 3a + 2 \equiv 0 \pmod{3}
   \]
   \[
   5a + 1 \equiv 2a + 1 \equiv 0 \pmod{3} \implies 2a \equiv -1 \equiv 2 \pmod{3} \implies a \equiv 1 \pmod{3}
   \]
   \[
   3a + 2 \equiv 0 \pmod{3} \implies 3a \equiv -2 \equiv 1 \pmod{3} \implies a \equiv 1 \pmod{3}
   \]
3. Next, consider divisibility by \( 5 \):
   \[
   5a + 1 \equiv 0 \pmod{5} \quad \text{or} \quad 3a + 2 \equiv 0 \pmod{5}
   \]
   \[
   5a + 1 \equiv 0 \pmod{5} \implies 5a \equiv -1 \equiv 4 \pmod{5} \implies a \equiv 4 \pmod{5}
   \]
   \[
   3a + 2 \equiv 0 \pmod{5} \implies 3a \equiv -2 \equiv 3 \pmod{5} \implies a \equiv 1 \pmod{5}
   \]
4. Combine the results using the Chinese Remainder Theorem:
   \[
   a \equiv 1 \pmod{3} \quad \text{and} \quad a \equiv 4 \pmod{5}
   \]
   Solve the system:
   \[
   a = 3k + 1
   \]
   \[
   3k + 1 \equiv 4 \pmod{5} \implies 3k \equiv 3 \pmod{5} \implies k \equiv 1 \pmod{5} \implies k = 5m + 1
   \]
   \[
   a = 3(5m + 1) + 1 = 15m + 4
   \]
   Therefore, \( a \equiv 4 \pmod{15} \).

The final answer is \( \boxed{2^n} \).