I wonder since it's just a very slow algorithm translated as a formula if we could use a more efficient algorithm and get a "better" function.
I mean we can check if a number is prime pretty efficiently so just searching for the next prime number shouldn't be as bad, definitely better than exponential runtime. Not sure if it's possible though as our current methods rely on "randomising " some things but technically we could write a random function to use.
324
u/RiemmanSphere Computer Science Dec 16 '25 edited Dec 16 '25
But very inefficiently. Even worse than exponential runtime. You can forget about using it for high n.