For centuries, Catholic priests wrote about how to subdue it. Some historians surmise Martin Luther had it, along with several renowned saints.
When he was in seventh grade, Cole M., now 23, saw an episode of "20/20" and surmised he had obsessive compulsive disorder, though he didn't the exact name of his disorder: scrupulosity.
Scrupulosity is a rare form of obsessive compulsive disorder focused on prayers, rituals or thoughts rather than the more common germ-phobia and compulsive hand washing.
"Whatever thing that is most important to you, that's what the obsessive compulsive disorder will grab," Cole said his therapist once told him. "My No. 1 fear was that I was going to become an evil person."
Cole, who asked that ABC News not use his last name, agreed to share his struggle with scrupulosity so that others might recognize it and get help.
Family and friends often have no idea that someone is suffering from scrupulosity, because it often manifests in silent rituals of the mind, says Simon Rego, associate director of psychology training at the Montefiore Medical Center in New York City.
Before he got treatment, Cole silently kept a ritual of finding the number seven in places and avoiding the number six.
Even during conversations, Cole silently counted, multiplied and added letters in words to make a sum of seven. For instance, take the sentence: The cat is gray. In less than a second Cole has an answer:
"Cat plus gray equals seven letters. The and is equals five," said Cole. "So, in order to get the [second] seven, I'd make the cross of the t count and the dot of the i count."
"Nobody would be able to tell that I'm doing this," Cole said.
Although it took a tremendous amount of mental energy to count during conversations and everyday life, Cole could not stop his consuming attachment to seven and fear of six. He explained the number 777 stuck in his mind from a newspaper classified ad he saw as a child that read "666 SIN 777 GOD."
"I consciously knew that there was nothing wrong with the number six and seven," Cole said.
"We need all the numbers, because otherwise we wouldn't be able to do math," he added with a laugh.
But Cole was still driven to count words, or to go through a 20-minute bowing ritual before religious iconography before going to school, or to never swear. Just like people who have other forms of obsessive compulsive behavior, Cole keeps up his rituals to quiet a fear and get back to his "just right" feeling.
"It's really not about religion and it's not about faith," said Jeff Szymanski, director of psychological services at McLean Hospital's Obsessive Compulsive Disorder Institute in Belmont, Mass.
What begins to drive a person with scrupulosity and with obsessive compulsive disorder are intrusive thoughts, Szymanski said.
"Everyone has intrusive thoughts," Szymanski said. But not everyone attaches a meaning to the thought in a way that spirals into obsessive compulsive behaviors.
"You have a new mother who's bathing a baby and she thinks 'what if I put the baby under the water?'" Szymanski said. "She might just say, 'oh that's weird, why did I think that?' but then she eventually dismisses it."