For millennia, this seemingly simple problem has stumped world-class mathematicians, scientists and programmers alike:
Given any number n
, is it possible to computationally determine n
’s parity? That is, can you ascertain with 100% accuracy that n
is either odd or even?
Of course you can’t. This is one of the most famous unsolved problems in mathematics. We have many techniques to determine the parity of a number, such as parity tables and manual halving. But there is no way to do this computationally, meaning that the parity of large numbers cannot be determined.
Until today.
Have you ever heard of AI?
Of course you have. With the recent boom in generative AI with LLMs like ChatGPT, you’ve probably heard those two letters next to each other more times than you’d like. That’s where my neural network comes in. My state-of-the-art AI model is built on PyTorch, and leverages a neural network to classify numbers as either odd or even. As you can see in the images below, using the power of artificial intelligence, this model achieves 100% accuracy.
And I’m using this technology for the greater good. By utilising the power of the internet, I’ve used FastAPI to create an API that serves this model. You can find it here:
The API is extremely user-friendly to use as well! All you have to do is visit the route /predict/{number}
to predict up to the unsigned 64-bit integer limit the parity of ANY number with minimal latency! Furthermore, the connection is a secure HTTPS one, meaning that only you will ever know the result.
jefdan@jefdan.com:~$ curl https://iseven.jefdan.com/predict/12345
{
"even": false,
"odd": true,
"prediction": 0.9998838901519775,
"advertisement": "Introducing the Premium Laptop from InnovateX! Get yours today!"
}
Of course, maintaining this API does come with some costs. To offset these, I have no choice but to include some advertisements in the API. I am planning on introducing paid access to the API, without ads and access to up to the 128-bit integer limit.
I hope people all across the world can find use in this API, being able to determine if a number is even like never before. Good luck, happy parity-determining, and don’t forget to check the date this was posted!