You can teach ChatGPT the meaning of a function, without providing an implementation, just by giving a few test cases. And then you can invoke it. And you can push it to a certain limit. Eventually, the results become not precisely correct, but still, they look plausible.