Sets of integers that turned out to be finite In the spirit of the previous question "Conjectures that have been disproved with extremely large counterexamples?", and as an attempt to salvage this closed question, I'm interested in sets of natural numbers or integers such that it was historically an open question whether they contained infinitely many numbers, but have now been proven to be finite.
For example, it is still not known whether there are infinitely many perfect numbers. If it were proved that there are in fact only finitely many, that would make them a valid answer to this question.
I know that one can easily make up trivial examples ("I don't know whether $A=\{n:|n|<10^{1000}\}$ is finite. Oh wait, it is. Done!") but those would not count as historical open questions.

Note: This is not identical to the previous question on extremely large counterexamples, because one may have an extremely large counterexample while still having infinitely many larger non-counterexamples.
 A: Many number-theoretic theorems are of the form:  all sufficiently large $n$ have property $P(n)$.  Thus until the theorem was proved, $\{n \in \mathbb N:\; \text{not }P(n)\}$ was not known to be finite, but now it is.
EDIT: E.g. for given positive integer $k$ and real number $\delta$ with $0 < \delta < 1$, Szemerédi's theorem says every sufficiently large $n$ has the property: every subset of $\{1, \ldots, n\}$ of size $\ge \delta n$ contains an arithmetic progression of length $k$.
A: One important recent (2013) result: Let $p_n$ be the $n$th prime. Let $G(m)= \min \{p_{n+1}-p_n:n\geq m\}.$ The result was that $\{G(m):m\in \mathbb N\}$ is finite. In particular that $G(m)<7\cdot 10^7$  for all sufficiently large $m$. Further work has replaced the value $7\cdot 10^7$ with a value less than  $300.$ (Sorry, I can't recall the details or names.) Equivalently,  there exist infinitely many  $n$ such that $p_{n+1}-p_n\leq 300.$
A: Here's an extreme one referenced in the article
"On the greatest common divisor
of the value of two polynomials"
in the July 2017
American Mathematical Monthly.
The reference is to
the Prime Glossary at
http://primes.utm.edu/glossary/xpage/LawOfSmall.html
$gcd(n^{17}+9, (n+1)^{17}+9)$
 seems to always be one. 
In fact, if you had your computer checking this for 
$n=1, 2, 3, . . .$ successively, 
it would never find a counter-example. That is because the first counter-example is the 52-digit number
8424432925592889329288197322308900672459420460792433.
A: Probably the most famous finite set of integers, that is hard to prove to be finite, is the set $B \subset \mathbb{N}$ of integers $n$ satisfying the statement of Burnside conjecture («All groups with exponent $n$ are locally finite»). This set is finite due to Adyan-Novikov theorem («There exists an infinite finitely generated group of exponent $n$ for any odd $n \geq 665$») and Ivanov theorem («There exists an infinite finitely generated group of exponent $n$ for any even $n \geq 2^{48}$»). However, despite $B$ is finite, its exact size remains unknown. The only numbers that are known for sure to belong to $B$ are 1, 2, 3, 4 and 6.
If you want something more tangible, then there is Zivcovic Theorem, that states, that there are finitely many numbers $n \in \mathbb{N}$, such, that $\Sigma_{k = 0}^{n - 1} {(-1)}^k (n - k)!$ is prime. Such numbers form the OEIS sequence A001272.
Another example of such nontrivially finite sets of integers can be found in this MSE question: Equation $x = \tau(2^x - 1)$. The equation here appeared to have exactly 7 solutions: 1, 2, 4, 6, 8, 16, and 32. 
And of course we should mention the set of all $n \in \mathbb{N}$, such that $\exists x, y, z \in \mathbb{N} x^n + y^n = z^n$. Actually, this set is two-element and contains only 1 and 2. This statement is called Fermat’s Last Theorem and was one of the most long-standing open problems (formulated by Fermat in 1637 and proved by Wiles in 1995)
