(ISTOCKPHOTO)

Contrary to Harry Nilsson’s 1968 song, 1 is not the loneliest number. That number is actually 7, according to David S. Kessler, who has an unusual neurological condition: He sees numbers as people. To him, 0 through 10 are specific characters he’s known his whole life. Each has a gender, an age, a personality and even a haircut.

It wasn’t until fourth grade that Kessler realized this was not the norm for everyone. So he mostly kept it under wraps, although after figuring out he was experiencing a form of synesthesia (a process in which a person’s senses are blended), Kessler started referring to it as “numesthesia.”

In 2014, not long after retiring from the National Zoo after 39 years, he read a blurb in The Post’s Reliable Source about a “Jeopardy” contestant like him.

That’s when he discovered he officially has ordinal linguistic personification, which Oliver Sacks mentioned in his 2007 book, “Musicophilia.”

Kessler still prefers the term he coined 40 years ago, so that’s the name of the play he has written for next month’s Capital Fringe Festival. He’s the only actor in “Numesthesia,” which he describes as the story of his numbers and how he has dealt with them.

This is not such an easy thing to explain to other people, Kessler says. For starters, they usually want to know when he “got it,” not understanding that this is how numbers have always appeared to him: 3 is a clumsy little girl, 5 is a teenage prankster who gets along with everyone (even 8, that lying bully!), and 10 is a regal, middle-aged woman who’s a great listener.

To him, they’re like characters in a novel. And they interact with each other, exclusively through multiplication. For instance, he explains, 24 is what you get when you multiply 4 (a self-critical nice guy) and 6 (an outdoorsy gal). “It’s 6’s way of saying she’s interested in him,” Kessler says. But not all couplings are good ones. “I have difficulty saying 56 because I don’t like to see those numbers together,” Kessler adds, noting that he doesn’t mean 5 and 6, but 7 and 8. (Seven reminds him of a young Lauren Bacall, and she could do much better.)

Over time, he has gotten to know more about the numbers. For Kessler, that has felt like a passive act, not a creative one. “I would watch the stories, but I didn’t feel like I was coming up with it,” Kessler says.

Not everyone can relate to this exact situation, Kessler adds, but he sees it as part of the play’s universal narrative.

“It’s about everybody, and how we perceive the world differently,” Kessler says.

When Kessler recently told his internist about what he’d been working on, she asked him if he’d seen a neurologist. His response? “Why? It’s not hurting me, and I don’t want it to change.” In his discussions with other synesthetes (including that “Jeopardy” contestant), they’ve agreed. “Most people feel it’s an addition to our lives. It’s more, not less,” he says.