The number 21731 (twenty-one thousand seven hundred thirty-one) is written in Roman numerals as follows: XXIDCCXXXI