Resistivity anomalies due to charge fluctuations of Ce and Pr impurities