The number 31731 (thirty-one thousand seven hundred thirty-one) is written in Roman numerals as follows: XXXIDCCXXXI