Old Testament readings use the Septuagint , the Scripture the apostles quoted. Masoretic numbering shown for reference.Learn why
LXX

2 Samuel 24:10

And the heart of David smote him after he had numbered the people; and David said to the Lord, I have sinned grievously, O Lord, [in] what I have now done: remove, I pray thee, the iniquity of thy servant, for I have been exceedingly foolish.

Read in other translations