Code-Driven Inductive Synthesis: Enhancing Reasoning Abilities of Large Language Models with Sequences