The number 31791 (thirty-one thousand seven hundred ninety-one) is written in Roman numerals as follows: XXXIDCCXCI