Learning richness modulates equality reasoning in neural networks