Gil Kalai writes:

2) Is it the case that people largely or even entirely lost their interest in the prime
numbers for about fifteen centuries until Fermat? What are the facts of the matter and what
are the reasons that may explain these facts.

It depends on who the people here are!

(a) In the Arabic-speaking world, where mathematics was alive and well, prime numbers did not lose their interest; in fact, as John Stillwell said above, the statement "Wilson's theorem" dates from that period.

(b) In most of Europe, there was essentially no pure mathematics of interest throughout the Middle Ages. (About the one exception is Fibonacci, who of course got at least part of his mathematical education outside Europe.)

Still, it would not surprise me if prime numbers turned out to be one of the few things in what we call number theory that was *ever* discussed in Western Europe during the Middle Ages. Reason: the popularity of Nicomachus's *Arithmetic*, translated (freely) by Boethius.

Boethius' Latin version was destined to exert a great influence on subsequent
encyclopedic authors of the sixth and seventh centuries and throughout the Middle Ages up
to the sixteenth century. From the sixth to the twelth century, when Greek geometry had
almost vanished and science was at its lowest ebb, Boethius's *Arithmetic*, for all its
faults, preserved the ideal of a theoretical science. Not until the thirteenth century,
when Jordanus de Nemore's *Arithmetic* appeared in ten books, do we have a theoretical
arithmetic on the Euclidean model, complete with proofs.

E. Grant, *A source book in medieval science*, Harvard U Press, 1974.

From a quick look at Nicomachus's original, it seems to be almost entirely about properties of integers, which are sometimes given a mystical or moral significance. Primality appears as one noteworthy property among several, side by side with being odd, even, triangular, pentagonal, heptagonal, perfect, superparticular, heteromecic, etc.

(Nothing or almost nothing non-trivial seems to be shown about any of these.)

As for Diophantus's *Arithmetic*, (a) it could not have an influence in Western Europe during the Middle Ages, as it was unknown there, (b) at any rate, it is largely about what we now would call the (highly ingenious!) construction of rational maps from n-dimensional affine space to varieties. There's very little in Diophantus about integers, and that as auxiliary material. Hence the fact that he does not really discuss prime numbers as such does not tell us much.

Mathematicsfor about fifteen centuries", after the end of the Hellenistic era? $\endgroup$ – Pietro Majer Sep 10 '12 at 22:13