Contradiction with 1 Samuel 24:1
It contradicts because in 1 Chronicles 21, David's numbering of Israel provokes God's anger, while in 1 Samuel 24, God incites David to take a census of the people.
1 Samuel 24:1: And it came to pass, when Saul was returned from following the Philistines, that it was told him, saying, Behold, David [is] in the wilderness of Engedi. [following: Heb. after]
Contradiction with 2 Samuel 24:1
The contradiction lies in the fact that 2 Samuel attributes the incitement of David to number Israel to the Lord, while 1 Chronicles attributes it to Satan.
2 Samuel 24:1: And again the anger of the LORD was kindled against Israel, and he moved David against them to say, Go, number Israel and Judah.