John Legend celebrated his 42nd birthday on Monday by taking on a mathematics challenge set up by his wife, model and TV personality Chrissy Teigen.

The All of Me hitmaker is currently on vacation with his family and close friends, photographer Mike Rosenthal and his celebrity hairstylist wife Jen Atkin, in St. Barts, and for his birthday, Chrissy staged a mini-game show between the two men, indulging them in their love of numbers.

"For John's birthday, we created the ultimate math-off competition. John and Mike love doing math," Chrissy explained in a series of posts on her Instagram Story timeline.

"To all of you at home, I just want to let you know, this is sixth-grade math. They have a 40-question math test in their hands. There will be bonus questions throughout the game," she went on.

John and Mike even dressed up in their best nerdy attire, complete with suspenders and plaid pants, while the R&B star also donned a pair of glasses bandaged at the bridge.

The birthday boy encountered a little trouble as he worked his way through the questions, confessing: "All the fractions and the exponents, I do not remember how to treat them."

However, he still managed to clinch victory over Mike as he was named the "math-off champion", earning himself a gold trophy, and as he celebrated his win, John quipped to host Chrissy: "I feel like I might get laid tonight."

The birthday trip to St. Barts comes after a rough few months for the couple, after Chrissy suffered a pregnancy loss in late September. The stars had been expecting their third child, a boy they had named Jack. They are already parents to daughter Luna, four, and son Miles, two.