The number 3871 (three thousand eight hundred seventy-one) is written in Roman numerals as follows: MMMDCCCLXXI