2 Samuel (Author Compiled by Isaiah from records of Samuel, David, Nathan, and Gad.)
Chapter 24
10And David's heart smote him after he had numbered the people. And David said to Jehovah, I have sinned greatly in what I have done; and now, I beseech thee, Jehovah, put away the iniquity of thy servant; for I have done very foolishly.
Original from The Bible Foundation - bf.org. They claim public domain status for their original text.