The forgiveness of particular venial sins comes about only through an act of fervor in the charity already possessed habitually. Aquinas rightly points out that this movement of contrition does not always occur. He writes, “it can happen that after someone has committed a venial sin, he will not actually think anything about abandoning the sin or holding to it, but he thinks perhaps that a triangle has three angles equal to two right angles; and in this thought he falls asleep and dies.“²⁷ Obviously, according to Aquinas’s argument, this geometer has not yet been forgiven for his sin. The guilt remains. Nevertheless, because he maintained the love of God, he would ultimately still be destined for the beatific vision.
— Fr. Luke Wilgenbusch, Saved as Through Fire: A Thomistic Account of Purgatory, Temporal Punishment, and Satisfaction
The clear takeaway is that excessive, habitual thoughts about math are not necessarily good for your soul. The footnote references Aquinas’s commentary on the Sentences, lib. 4, dist. 21, q. 1, a. 3, qc. 1: “Potest autem quod aliquis postquam veniale peccatum commisit, nihil actualiter cogitet de peccato vel dimittendo vel tenendo; sed cogitet forte quod triangulus habet tres angulos aequales duobus rectis; et in hac cogitatione obdormiat, et moriatur.”