Answer
1983.13 N/m
Work Step by Step
Let's take,
The cross-sectional area of the piston = A
Length of the cylinder = L
The volume of the cylinder = V
According to Boyle's law, we can write,
$P_{1}V_{1}=P_{2}V_{2}=>P_{2}=\frac{P_{1}V_{1}}{V_{2}}=P_{1}(\frac{AL_{1}}{AL_{2}})=P_{1}(\frac{L_{1}}{L_{2}})$
Let's plug known values into this equation.
$P_{2}=(1.01\times10^{5}Pa)(\frac{L}{2L})=5.05\times10^{4}Pa$
The force on the piston = $P_{2}A=kx$
and spring (F)
$k=\frac{P_{2}A}{x}=\frac{(5.05\times10^{4}Pa)\pi(0.05\space m)^{2}}{0.2\space m}=1983.13\space N/m$
Spring constant = 1983.13 N/m