Resonance effects in neutron scattering lengths of rare-earth nuclides