The number 138317 (one hundred thirty-eight thousand three hundred seventeen) is written in Roman numerals as follows: CXXXVIIICCCXVII