The issue is thorny ...
According to Morris Kline, Mathematical Thought from Ancient to Modern Time. Volume I (1972), page 272 [only entry of the Subject Index regarding : mathematical Induction] :
The method was recognized explicitly by Maurolycus in his Arithmetica of 1575 and was used by him to prove, for example, that $1+3+5+ \ldots + (2n+1)=n^2$. Pascal in one of his letters acknowledged Maurolycus's introduction of the method and used it himself in his Traité du triangle arithmétique (1665), wherein he presents what we now call the Pascal triangle.
The modern source is Giovanni Vacca (1872 –1953) Italian mathematician, assistant to Giuseppe Peano and historian of science in his :
with comments in :
Acording to Kline :
the method [of mathematical induction] is implicit even in Euclid's proof of the infinitude of the number of primes [IX, 20].
This point is debatable.
Euclid, The Thirteen Books of the Elements, Vol. 2: Books III - IX (T.L.Heath editor), states IX.20 as follows [page 412] :
Prime numbers are more than any assigned multitude of prime numbers.
The proof is per impossibile. According to Heath's comment [page 413] :
We have here the important proposition that the number of prime numbers is infinite.
Neither in the statement of the proposition nor in its proof Euclid uses the work infinite [apeiros -on : adj, infinite].
In can be helpful to place it in the context of Grrek debate about the infinite : see Aristotle and Mathematics on the actual infinity.
According to the Aristotelian philosophy, we cannot legitimately "conceive" actual infinity; i.e. we have no experience of an infinite "collection" but only of an unlimited iterative process (the potential infinity).
Euclid's statement must be understood in this context : we never have a "complete" infinite set of prime numbers, but we have a "procedure" that, for a finite collection of prime numbers whatever, can "produce" a new prime which is not in the collection.
The only occurrence (not regarding straight lines) I've found of the word infinite (searching into : EUCLID’S ELEMENTS OF GEOMETRY, the Greek text of J.L. Heiberg (1883–1885), edited, and provided with a modern English translation, by Richard Fitzpatrick), is VII,31 [Heath ed, page 332] :
Any composite number is measured by some prime number.
The proof uses the fact that :
For, if it is not found [some prime number which will measure the number before it, which will also measure A], an infinite series of numbers [emphasis added] will measure the number A, each of which is less than the other: which is impossible in numbers.
It seems the only reasonable "candidate" for a precursor of the least number principle [see the comment of Ian Mueller, Philosophy of Mathematics and Deductive Structure in Euclid's Elements (1981, Dover reprint), page 77].
According to :
the Greeks [...] did not have mathematical induction [...].
Regarding Pappus, in