Let's denote Peter's number as \( x \). According to the problem, we can set up the following equation based on the information provided:
- Subtract 17 from Peter's number: \( x - 17 \)
- Multiply the difference by -2: \( -2(x - 17) \)
- Set this equal to -42:
\[ -2(x - 17) = -42 \]
Now, let's solve the equation step by step:
- Distribute -2 on the left side:
\[ -2x + 34 = -42 \]
- Subtract 34 from both sides:
\[ -2x = -42 - 34 \] \[ -2x = -76 \]
- Divide both sides by -2:
\[ x = \frac{-76}{-2} \] \[ x = 38 \]
So, Peter's number is \( \boxed{38} \).