The number 40821 (forty thousand eight hundred twenty-one) is written in Roman numerals as follows: XLDCCCXXI