Solution (source code)

= Solution

Take the wires along $z$, with the first at $x=0$ carrying $+I\hat{\mathbf z}$, and observe at $x=-a$. The <Biot-Savart law> gives a first-wire field in $-\hat{\mathbf y}$; wire $n$ is $na$ away. Therefore
$$
\mathbf B=-\frac{\mu_0I}{2\pi a}\hat{\mathbf y}\sum_{n=1}^N(-1)^{n-1}n^2.
$$
Pairing adjacent terms, with $N=2m$,
$$
\sum_{j=1}^m[(2j-1)^2-(2j)^2]
=\sum_{j=1}^m(1-4j)=-\frac{N(N+1)}2.
$$
Thus $\boxed{\mathbf B=\mu_0IN(N+1)\hat{\mathbf y}/(4\pi a)}$. Its direction is opposite to the field of the first wire at the observation point. Reversing every <electric current> reverses this answer.