First off, you can not just take one or two verses to make a point. You need more, and you have to keep it in context. You also need to look at the original words and what they meant during that time. Maybe the translation was not totally correct. There is more to studying the scriptures than just comparing a few verses and then say it contradicts it's self.
That being said, in 2Sa 24:1, without reading the last chapter, we do not know who 'he' was referring to. It could have ment the Lord, however, that verse only states that the anger of the Lord was kindled and the 'he' in that verse could mean someone other than the Lord.
In 1Ch 21:1 the word translated to 'Satan' could also mean 'adversary' or 'opponent'.
H7854
שׂטן
śâṭân
saw-tawn'
From H7853; an opponent; especially (with the article prefixed) Satan, the arch enemy of good: - adversary, Satan, withstand.
Without reading both chapters and getting the context and ruling out who the 'he' in 2Sa 24:1 was referring to we can not be sure. What I would suggest is that you do a bit more studying.
And if you were only trying to discredit the Bible, you would have to do better than that for those of us who know how to actually study and truly try to understand it.