The number 5842 (five thousand eight hundred forty-two) is written in Roman numerals as follows: VDCCCXLII