Find all integers $k$ such that both $k + 1$ and $16k + 1$ are perfect squares.
1. We start by setting up the equations given in the problem. Let $k + 1 = n^2$ and $16k + 1 = m^2$ for some integers $n$ and $m$.

2. From the first equation, we can express $k$ in terms of $n$:
   \[
   k + 1 = n^2 \implies k = n^2 - 1
   \]

3. Substitute $k = n^2 - 1$ into the second equation:
   \[
   16k + 1 = m^2 \implies 16(n^2 - 1) + 1 = m^2
   \]
   Simplify the equation:
   \[
   16n^2 - 16 + 1 = m^2 \implies 16n^2 - 15 = m^2
   \]

4. We now have the equation:
   \[
   16n^2 - m^2 = 15
   \]
   This can be factored as a difference of squares:
   \[
   (4n - m)(4n + m) = 15
   \]

5. We need to find integer pairs $(a, b)$ such that $a \cdot b = 15$. The possible pairs are:
   \[
   (1, 15), (-1, -15), (3, 5), (-3, -5), (15, 1), (-15, -1), (5, 3), (-5, -3)
   \]

6. We solve for $n$ and $m$ for each pair:
   - For $(4n - m, 4n + m) = (1, 15)$:
     \[
     4n - m = 1 \quad \text{and} \quad 4n + m = 15
     \]
     Adding these equations:
     \[
     8n = 16 \implies n = 2
     \]
     Subtracting the first from the second:
     \[
     2m = 14 \implies m = 7
     \]
     Thus, $k = n^2 - 1 = 2^2 - 1 = 3$.

   - For $(4n - m, 4n + m) = (-1, -15)$:
     \[
     4n - m = -1 \quad \text{and} \quad 4n + m = -15
     \]
     Adding these equations:
     \[
     8n = -16 \implies n = -2
     \]
     Subtracting the first from the second:
     \[
     2m = -14 \implies m = -7
     \]
     Thus, $k = n^2 - 1 = (-2)^2 - 1 = 3$.

   - For $(4n - m, 4n + m) = (3, 5)$:
     \[
     4n - m = 3 \quad \text{and} \quad 4n + m = 5
     \]
     Adding these equations:
     \[
     8n = 8 \implies n = 1
     \]
     Subtracting the first from the second:
     \[
     2m = 2 \implies m = 1
     \]
     Thus, $k = n^2 - 1 = 1^2 - 1 = 0$.

   - For $(4n - m, 4n + m) = (-3, -5)$:
     \[
     4n - m = -3 \quad \text{and} \quad 4n + m = -5
     \]
     Adding these equations:
     \[
     8n = -8 \implies n = -1
     \]
     Subtracting the first from the second:
     \[
     2m = -2 \implies m = -1
     \]
     Thus, $k = n^2 - 1 = (-1)^2 - 1 = 0$.

   - For the remaining pairs $(15, 1)$, $(-15, -1)$, $(5, 3)$, and $(-5, -3)$, we find that they yield the same values for $k$ as the pairs already considered.

7. Therefore, the only integer solutions for $k$ are $k = 0$ and $k = 3$.

The final answer is $\boxed{k = 0 \text{ and } k = 3}$.