The number 9871 (nine thousand eight hundred seventy-one) is written in Roman numerals as follows: IXDCCCLXXI