The number 31971 (thirty-one thousand nine hundred seventy-one) is written in Roman numerals as follows: XXXICMLXXI