"Only a finite number" or "only finite number"

The question is contained in the title. I think that the noun "number" is countable, therefore "only a finite number" is correct. However, on mathoverflow the expression "only finite number" is also used, although less often that "only a finite number":

https://mathoverflow.net/search?q=%22only+finite+number%22

https://mathoverflow.net/search?q=%22only+a+finite+number%22

So, which of the following patterns can I use? "There is only a finite number of \$f\$ such that...", or "There are only finite number of \$f\$ such that...", or maybe something else?

Whether or not you use the article a depends on what exactly you want to say. But, only finite number is not correct. I took a peek at a few of the only finite number posts from your link, and every one I looked at (which was not anywhere close to all of them, mind) should have been a finite number. The fact that the search which includes a is ten times more common than the one without hints that a finite number is correct.

If you want to say something along the lines of the available or eligible amount or quantity of X is limited or has an upper bound, then use only a finite number of X. This phrase means, essentially, a limited quantity of something and is by far the most commonly used version of this construction.

If you want to say something along the lines of there are only so many groups or categories of Y or unbounded or infinite Y values are not eligible for consideration, then use only finite numbers of Y. Note that numbers is plural. This phrase is quite uncommon. If you're unsure which to use, it's more likely that a finite number is correct.

Examples:

There's only a finite number of options.
Only a finite number of equations model the data.

There are only finite numbers of animals belonging to endangered species alive today.
The function produces only finite numbers; infinite values are never returned.

Number is a singular noun, so you should use a before it.

A finite number is the right construction. Don't go by connotation; number here is a collective noun but still singular.

Ya, what they said... "Only a finite number of oranges..." is the grammatical one. However, from a mathematical perspective it is more polished to say "(there are) finitely many (oranges)....", because "only" is redundant when talking about finite-ness.