Solving for the particle-number-projected HFB wavefunction