The number 34871 (thirty-four thousand eight hundred seventy-one) is written in Roman numerals as follows: XXXIVDCCCLXXI