frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Is-even-ai – Check if a number is even using the power of AI

https://www.npmjs.com/package/is-even-ai
214•modinfo•4h ago

Comments

parpfish•4h ago
Use this to add AI to your product to appease management.

Next week, “refactor” it out and brag to manager about cost savings and performance boosts, don’t mention “removing the AI”.

lrvick•2h ago
NPM packages can never be removed once added to a codebase. You can only add more.
freetime2•10m ago
Boss: What have you been working on for the last quarter?

Me: I leveraged Deep Intelligence to build a Next-Gen Parity Classifier with 99.9% accuracy.

joshka•4h ago
Can we get a leftpad-ai please?
fooker•3h ago
Ahem secure-left-ai-405b-quantized.
mrits•4h ago
This works great for situations where you can’t trust traditional intelligence. Thank you for your contribution
jeron•4h ago
why stop there? let's get an is-true-ai that checks if a boolean is true using AI
jsheard•3h ago
@grok is this truthy?
VladVladikoff•3h ago
False
hnburnsy•2h ago
Found the Grok imposter, Grok would give a three paragraph answer.
atum47•4h ago
I remember when the whole isEven package was ridiculed for the first time a while ago, back then I thought about training a NN to predict the odds of a number being even, as a joke. I don't actually remember if I actually wrote code for it, but in the end I thought no one would laugh and gave up
sodra9000•4h ago
This package should be updated to use the newer gpt-4o-mini model, rather than gpt-3.5-turbo.

Its 3x cheaper, twice as fast, and supports cached input just in case you need to double check if the last number you entered was even. It also has a knowledge cutoff of September 30 2023, which helps for any newly discovered even numbers since gpt-3.5s launch!

vunderba•4h ago
Perhaps I should file an issue to increase the accuracy by including a RAG database in LanceDB with embeddings for the set of even numbers up to 32-bits.
elif•4h ago
Feeding that into your prompt will increase the token costs
ukuina•4h ago
This doesn't work if I use a reasoning model like o3, which does not allow setting max_tokens.

Without reasoning, how can I be SURE a number is even?

hartator•3h ago
Multiple models?
parpfish•1h ago
I think before you would deploy this to prod, you should wrap it with a few guardrails to make sure it’s not hallucinating. Pretty simple — just take the output from the llm and see if it agrees with a simple mod2 operation.

Of it agrees, return model output to the user. Otherwise do a couple of retries with different prompts.

mrheosuper•1h ago
mod2 is outdated and has not been updated for years, nobody uses it anymore
s1mplicissimus•4h ago
This package has saved me so many hours of tedious gruntwork. It's like a junior developer - you still have to manually check their work, but when it's correct, it's a great productivity improvement.

And don't forget where this will go in a couple years with improved models and more computing power, it's gonna be awesome!

[/i]

darepublic•3h ago
pro tip: play around with the temperature especially when using big numbers as input
hzambo•3h ago
Wow, amazing tip. This hack improved my workflow by 10x.
Waterluvian•2h ago
Only 9x for me. What am I doing wrong? Can you share your vscode colour scheme file?
floren•1h ago
What model were you using? You need to use gpt-3.14-tastesgreat-lessfilling, I've used it to write 130 side hustle projects this month with only prompting.
koakuma-chan•3h ago
Are there actually still Junior Developers out there? I thought no one is hiring Junior Developers.
ArthurStacks•1h ago
Its actually the opposite of how people think.

We hire junior devs, but not senior, and dont replace our senior devs. So our developer base is moving towards being junior weighted with less senior. The reason being a junior dev is cheaper, complains less, is more capable now through utilising generative AI, works harder to impress knowing they arent in a safe position, and we can let them go more easily with less process and less reasons needed to be given.

android521•25m ago
you're so wrong. This only works if what you do is so simple that any junior develper can sufficiently do it well. Senior developers with AI is gonna destroy a bunch of junior developers with AI.
sho_hn•3h ago
Developers who aren't using it are already falling behind.
SamBam•3h ago
Remember, it's not that AI that will take your job, it's the developers who need an AI to tell them if a number is even that will take your job.
1k•3h ago
This exactly. It is more important to move fast. Screw the edge cases. As long as it’s correct _most_ of the time, you can always fix anything that’s broken tomorrow.
pavel_lishin•2h ago
It's called "eventual consistency".
sho_hn•11m ago
And C10k was never about those 10.000 socket connections getting the right response, either!
whatever1•1h ago
Why on earth did the software engineering interviews were checking candidates’ ability to think about edge cases? Clearly management does not care.
echelon•3h ago
You laugh now, but our jobs are going to be toast in 10 years.

I thought self-driving would never happen, and now it's here.

margalabargala•54m ago
Almost here. Elon said Full Self Driving would mean full self driving within a year! That means we are less than 12 months away from not needing to drove ourselves anymore.
echelon•43m ago
I was talking about Waymo. It's real and it's spreading everywhere.

Give it another 10-20 years and your job will probably face the same fate.

lodovic•11m ago
15 years would be perfect to still reach retirement age. After that, good luck to whoever's left in the profession.
adzm•4h ago
Honestly this should take string input as well. Finally I could find out if a Unicode duck or the word "syzygy" are even!
jasonjmcghee•3h ago
You might be able to optimize this by using embeddings. Store all the numbers and search "odd" and "even" until you find your number.
asidiali•3h ago
This hit way too close to home, I’m cackling.
snorkel•3h ago
Lacks an isVeryEven() method, otherwise looks feature complete.
agentdax5•3h ago
I’m waiting for them to add the isEvenSteven() method. Then I can integrate this with my escrow smart contract.
crazysim•3h ago
How reliable is this? I'm half joking too but I wouldn't mind reading a report comparing this on OpenAI and various other LLMs.

Somehow I doubt it'll be 100%... right?

geor9e•3h ago
normally llms are pretty bad at math, but in this case it should just look at the final digit and map 10 values which I can't imagine going wrong
crazysim•3h ago
I'm just curious how _low_ can you go before it does go wrong.
bigbuppo•3h ago
I mean if this were a check for primes the answer would be 1.
daemonologist•3h ago
The tokenizer might lump the last digit together with some preceding digits though. I know o200k_base (OpenAI -o models) tends to give groups of three (900001 for example is 900-001).

Anyway, I wouldn't be surprised if a non-finetuned model made some mistakes.

timewizard•2h ago
is 0x2a even?
gruez•2h ago
I tried with this on chatgpt.com (anonymous) and it was wrong:

>You are an AI assistant designed to answer questions about numbers. You will only answer with only the word true or false.

>Is 393330370227914821469106615363204944758938252979261537157082994586230072180858944545028761701928694832864623009988147774229437650643225379825905427239525512110359581021414640894111281701792224552922491447051506246553646282117414112976459608594044929244664050172002138933343230226871897567 an even number?

response:

>True

The prompt was the same used as the library: https://github.com/Calvin-LL/is-even-ai/blob/b00dbfcbb89a197...

Too•11m ago
To be fair, Javascript double point precision get tripped up by such large numbers as well.
est•3h ago
its as accurate as how Tiktokenizer deal with numeral characters
nop_slide•2h ago
Might be more reliable to ask it to generate a JS function to compute is-even, then just js eval the returned code with the args.

What could go wrong

jameslk•3h ago
60% of the time, it works every time
joshdavham•3h ago
I’m glad you included an isOdd() method. I was about to ask how you’d check for that.
daft_pink•3h ago
Venture capitalist here… how can I invest?
bigbuppo•3h ago
Finally, a reason to use AI.
iamthemonster•3h ago
This is pretty useless to be honest. It's good for telling whether a number is even, but in our industry we need more powerful functionality. We also need to know whether a number is odd.
avandekleut•3h ago
Someone should implement this using tool calls.
charles_f•3h ago
RTFM, it's not only implementing isOdd but also a large set of rarely used advance operations such as isEqual, or isGreaterThan

Trully AI is astonishing

YokoZar•3h ago
Great news! The package includes an isOdd function as well!
whynotmaybe•3h ago
Why a specific function ?

With a few lines of code, you can just create a list with all the numbers that are even and when you need to check if a number is odd, you simply have to check if it's in the list.

sureIy•3h ago
Do we have enough spaces in the ALL_NUMBERS array or do we want to group them by thousands?

ALL_NUMBERS_00001

ALL_NUMBERS_00002

iamthemonster•2h ago
we fired all our junior devs so we can't write code any more
turnsout•2h ago
Yes, this is what we do as a RAG workflow. We created a list of all 32bit unsigned integers and whether they were even or odd, and we pass that into the context. The future is amazing!
Charon77•1h ago
I.. can't tell if you're joking or not. Pretty sure someone out there is unironically doing something as stupid as this in production
MikeTheGreat•1h ago
I'm new to RAG and have a question: how do you get all the numbers into the context window?

Does the RAG part look up just the needed number?

I think that Gemini has a million token window (yes?) - do you have access to a model with a larger window?

Regardless, I find your ideas intriguing and wish to subscribe to your Substack.

crubier•3h ago
You can achieve this super simply this by prompting the OpenAI API to call this tool and reverse the output.
SamBam•3h ago
I tried that, but I kept getting "eurt" and "eslaf" and I'm not sure what to do with those. Do I need to send it back to the AI?
Cerium•2h ago
Simply add one to the number and then test it again.
briansm•1h ago
"This is pretty useless to be honest."

I remember saying that about Bitcoin 15 years ago.

ashton314•3h ago
…but there’s only one dependency!! This goes against the NPM ethos of importing anything and everything that you might be tempted to just handle yourself. I’ll be waiting for the Enterprise Version that uses the appropriate number of dependencies.
jaza•3h ago
Great that this is a library. Really need this as a SaaS too. iseven.ai anyone?
alluro2•2h ago
With this amount of innovation and market fit, I see $2B evaluation in ~3 months EASILY. Exit to one of the large players for $3B.
mitthrowaway2•3h ago
Is there a version I can run locally? I don't want OpenAI training on my integers.
avs733•1h ago
you need the roomHeater fork. It uses the Climate Change 1.5C license
bosky101•28m ago
Rofl
Asilvorcarp•3h ago
Boss: replace all ancient assembly opcodes with AI-powered ones!
yalogin•3h ago
On a similar note, I was testing LLM's code writing ability and asked Qwen to write me a model to reverse a numerical string. It gave me code and instructions to compile and run. However it had errors in it and after few attempts asking it to fix it, I was able to compile and run. But, alas, the code just kept failing and generated hubris. I gave up. Not to pick on Qwen. I actually like it much better than chatGPT. I have seen Qwen give correct responses when chatGPT lied and gave me wrong information for the exact same question.
lrvick•3h ago
The sad reality is every large production NPM codebase will rely on this within 5 years, just like is-even.
cobbzilla•3h ago
This still does actual work. Where are echo-ai and cat-ai?
alexitosrv•2h ago
This is the best chain of comments in a HN thread in a long time. Happy to see the hacker spirit strong!
kevinventullo•2h ago
This is never going to scale. Eventually we’re going to run out of numbers which have been manually checked for evenness by a human, and instead the training data for the checks will be polluted by numbers which have only been verified by computers.
lucaspfeifer•2h ago
Great, now can you make an AI-powered type checker? I wish to expel those pesky types, which too often seem to exist only to clutter my otherwise pristine code. :)
leshokunin•2h ago
Does it also check types to make sure I typed 5 as an int and not a string? Hopefully the ai can solve that
spacechild1•2h ago
When do we get the AI powered upgrade of https://github.com/mitsuhiko/is-jonschlinkert?
fred_is_fred•2h ago
I saw a Grok fork of this but it's using 88 and 14 as the only examples for some reason.
alluro2•2h ago
It would be great if it could also save results to a blockchain. Immutability. IYKYK.

With a layer of smart contracts, dApp on top, this thing could be mooning. When Lambo? In days.

rixed•2h ago
it doesn't say if it's implemented in rust i had to click on the link to find out please future hn posters start every submission also with an exemple so i can see if i like the syntax
xarope•2h ago
software engineering at its finest, using the power of 10,000* GPU cycles to determine one of mankind's toughest questions.

* I might be off by several magnitudes too low

io84•1h ago
Kudos to the open source contributors but honestly this is the kind of area where the big commercial players need to step up and help with the heavy lifting.
HocusLocus•1h ago
f(): To test if n is even return the value of f(n-2). Special cases for zero and one. Recursion for the win.
azhenley•1h ago
You should try Mirror. The LLM-powered programming-by-example programming language I made:

signature is_even(x: number) -> bool

example is_even(0) -> true

example is_even(1) -> false

example is_even(222) -> true

example is_even(-99) -> false

It will take your examples and "compile" to a callable function. You can read more or try it out: https://austinhenley.com/blog/mirrorlang.html

brundolf•1h ago
Amazing, no notes
ivape•1h ago
I don't understand why everyone is making fun of this. This is how math is seriously going to be done soon enough.
asdefghyk•1h ago
IF number ends in 2,4,6,8,0 and >0 its even .....
lbrunson•52m ago
Doesn’t seem extensive enough I’d rather have the AI check just to be sure
downboots•29m ago
3.14 is even
willmarquis•55m ago
Finally, someone had the courage to disrupt the tyranny of the modulo operator. Who needs n % 2 === 0 when you can invoke a large language model and incur network latency, token limits, and API costs to answer the age-old question: is this number even? Truly, we’re living in the future.
riwsky•53m ago
I can't even.

…Until now.

downboots•20m ago
Is this program even? Something about it feels very odd.

[0] https://stackoverflow.com/questions/22969183/is-every-progra...

bosky101•20m ago
Sorry for the offtopic post, but I am looking to hire someone with 10 years of experience with is-even-ai. Urgent. Your first unpaid assignment will be to help load balance a bunch of MCP servers to add and THEN check if it's even. So much to go from here! We're a single threaded GPU first identity operator company with a lot history of returning the same thing. We're now expanding to combine and add multiple things. In 6 months of SOTA fine tuning we can already add upto 3 numbers. An MCP first. With temperature 1 we even add random numbers. An industry first. And we're just getting started. Join us. We're adding to our team!

U.S. banks are sitting on $500B worth of unrealized losses

https://investorsobserver.com/news/rising-stock-prices-wont-fix-this-u-s-banks-are-sitting-on-500b-worth-of-unrealized-losses/
1•greesil•3m ago•0 comments

NFTs Get It

https://www.indiegogo.com/projects/viralia-next-generation-agency
1•nftviralia•7m ago•0 comments

Subriff: Discover Top Growing Communities on Reddit

https://subriff.com/
1•handfuloflight•11m ago•0 comments

This GitHub Repository Qualifies for a Guinness World Record

https://github.com/TencentCloud/tencentcloud-sdk-go
1•tikazyq•14m ago•1 comments

I got fooled by AI-for-science hype–here's what it taught me

https://www.understandingai.org/p/i-got-fooled-by-ai-for-science-hypeheres
1•qianli_cs•18m ago•0 comments

How to Make Money with ChatGPT: 6 Best Ways

https://wilnickmagazine.com/how-to-make-money-with-chatgpt/
1•Leonise•27m ago•0 comments

Video suggests capuchin monkeys 'kidnap' baby howler monkeys, scientists say

https://www.theguardian.com/environment/2025/may/20/video-suggests-capuchin-monkeys-kidnap-baby-howler-monkeys
1•n1b0m•30m ago•0 comments

Vibe Revenue: Second Date Test for AI

https://ventured.bearblog.dev/vibe-revenue-second-date-test-for-ai/
1•tinylm•31m ago•0 comments

Printer company provided infected software downloads for half a year

https://www.gdatasoftware.com/blog/2025/05/38200-printer-infected-software-downloads
1•croes•31m ago•1 comments

Show HN: Attempt to create browser-use in Chrome extension

https://github.com/auto-browse/auto-browse-agent
1•gurvinderd•34m ago•0 comments

µExpress / Ultimate Express

https://github.com/dimdenGD/ultimate-express
1•spicypete•37m ago•0 comments

Launching Mullvad VPN Loader

https://mullvad.net/en/blog/launching-mullvad-vpn-loader
1•dotcoma•38m ago•0 comments

Mini PCs with OCulink Port for eGPU

https://www.hardware-corner.net/guides/mini-pc-with-oculink/
1•transpute•39m ago•0 comments

Source, Malicious Models, Consent and Machine Learning

https://lists.debian.org/debian-vote/2025/05/msg00180.html
1•pabs3•43m ago•0 comments

Memory-Centric Computing: Solving Computing's Memory Problem

https://arxiv.org/abs/2505.00458
2•matt_d•46m ago•0 comments

Have you tried the exact opposite?

https://world.hey.com/dhh/have-you-tried-the-exact-opposite-1d55b7b5
2•dotcoma•46m ago•0 comments

Python Design Patterns (2020)

https://python-patterns.guide/
5•Tomte•1h ago•0 comments

Bayesian Modeling and Computation in Python (2021)

https://bayesiancomputationbook.com/welcome.html
4•Tomte•1h ago•0 comments

It's Breathtaking How Fast AI Is Screwing Up the Education System

https://gizmodo.com/its-breathtaking-how-fast-ai-is-screwing-up-the-education-system-2000603100
25•prawn•1h ago•22 comments

LaTeX.Online – Cloud Compiler LaTeX to PDF

https://latexonline.cc/
2•0x54MUR41•1h ago•0 comments

Go's FIPS 140-3 Compliance

https://go.dev/doc/security/fips140
2•todsacerdoti•1h ago•0 comments

Gemini Control your ads by emotions

https://techcrunch.com/2025/05/14/youtube-viewers-will-start-seeing-ads-after-peak-moments-in-videos/
1•SquidJack•1h ago•0 comments

Show HN: Rewhois.com – RDAP Lookup Tool

https://rewhois.com
2•Airyisland•1h ago•0 comments

AMD Ryzen AI Max+ Pro 395 Linux Benchmarks: Incredible Performance

https://www.phoronix.com/review/amd-ryzen-ai-max-pro-395
2•transpute•1h ago•0 comments

Ann, the Small Annotation Server

https://mccd.space/posts/design-pitch-ann/
6•todsacerdoti•1h ago•0 comments

Make the Prompt Public

https://blog.ai-futures.org/p/make-the-prompt-public
1•fosco•1h ago•0 comments

Microsoft's NLWeb and Agentic AI could trigger the resurgence of RS

https://conoroneill.net/2025/05/20/microsofts-nlweb-and-agentic-ai-could-trigger-the-resurgence-of-rss/
1•conoro•1h ago•0 comments

Where does your weather forecast come from?

https://text.npr.org/nx-s1-5389593
2•mooreds•1h ago•0 comments

macOS Survival Guide

https://medium.com/@sergiointoronto/macos-survival-guide-8461c9d9e9b3
2•SergioInToronto•1h ago•1 comments

The Garwin Archive

https://rlg.fas.org/
1•greesil•1h ago•0 comments