This is a 'look-and-say' sequence. Each term describes the digits of the previous term. The term '3112221' consists of: one 3, two 1s, three 2s, and one 1. Thus, the next term is 13213211. The stored answer 1113213211 is slightly off from the standard logic.