The number 40171 (forty thousand one hundred seventy-one) is written in Roman numerals as follows: XLCLXXI