The number 18871 (eighteen thousand eight hundred seventy-one) is written in Roman numerals as follows: XVIIIDCCCLXXI