The old Greek did not consider 1 a number, so it was not a prime. The theorem of unique prime factorization excludes 1 to be a prime number. But in between probably at Euler's and Goldbach's times? Who can determine most precisely (probably by original papers) when 1 first became a prime number and when 1 had been called a prime number for the last time?
closed as no longer relevant by Felipe Voloch, Gerald Edgar, Asaf Karagila, Suvrit, Bill Johnson Apr 28 '12 at 23:05
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. If this question can be reworded to fit the rules in the help center, please edit the question.
Both Euler and Goldbach counted 1 as a prime in certain situations (variants of Goldbach's conjecture), and did exclude 1 whenever it suited them (arithmetical functions). The question whether 1 is prime or not was not so terribly important before unique factorization was discovered as a fundamental principle by Gauss.
Edit. Here's a nice episode: when Wallis "solved" Fermat's challenge to find a cube whose sum of divisors is a square (Fermat had given the example $\sigma(343) = 20^2$) by claiming that $1$ does it, Fermat was insulted. Wallis then complained that Fermat was not content with this solution and pretended that this was because "some do not admit that $1$ is a number," and remarked that others do.
By the way, in his own solution of the problem $1+p+p^2+p^3 = x^2$ for primes $p$, Fermat showed that the only solutions are $p = 1$ and $p = 7$, so he counted $1$ as a prime number.
My naive understanding is like this: most, but not all, of the ancient Greeks excluded one from the category of numbers ($\alpha\rho\iota\theta\mu o\varsigma$), hence from the primes (others excluded two as well). Speussippus (c.350BC) is a rare exception:
Speussippus, then, is exceptional among pre-Hellenistic thinkers in that he considers one to be the first prime number. [L. Taran, Speusippus of Athens: a critical study with a collection of the related texts and commentary, Philosophia antiqua, vol. 39-40, E.J. Brill, 1981]
This view held (mostly) until Stevin's argument that one was a number and his development of the reals (late 16th century)
In general, mathematics before Stevin is of one character and, after him, it is of another re ecting his contributions. In this regard, he is like Euclid: he stood at a watershed in the history of mathematics. And as with Euclid, he was so successful that, from our present day vantage point, it is hard to see the other side of that watershed. Over there, one was not a number; here and now, it is; even is a number, and i, and aleph nul. [C. J. Jones, The concept of one as a number, Ph.D. thesis, University of Toronto, 1978.]
Now we enter a period of confusion. The view of one as a non-number slowly begins to die out, and some (e.g., Brancker + Pell's table 1688) begin to list one as a prime.
Not a prime for Schooten 1657, Clerke 1682, Chales 1690, Ozanam 1691, Brunot 1723, Cortes 1724, Reyneau 1739, Euler 1770, Horsley 1772, ... A prime for Wallis 1685, Goldbach 1742, Kruger 1746, Willich 1759, Lambert 1770, Felkel 1776, Warring 1782, ... (Not these folks may have used both views at times, as many of us alternate between ln and log for the natural log, depending on our audience)
The beginning of the end comes with Gauss' Disquisitiones Arithmeticae as the Fundamental theorem of arithmetic, and especially the uniqueness of factorization, becomes central. At about the same time number fields are introduced and the role of units becomes understood. I could give a long list (like the above) of yeses and nos in this period as well. But the choice of excluding one from the primes gains superiority and is now essentially universal among mathematicians.
Was there a time one was almost universally considered a prime? Absolutely not. Was there a time it was almost universally considered a non-prime: yes, much of history.
Edited to add "last time" from comments:
It might be that the last major mathematician "wrote" that one was a prime in print was G. H. Hardy, who lists one as a prime in his "A course of pure mathematics, "3rd ed., Cambridge University Press, 1921:
If there are only a finite number of primes let them be 1, 2, 3, 5, 7, 11, ... $N$. [section 61, page 143-144]
He does is indirectly later in this text:
the decimal $.111\ 010\ 100\ 010\ 10\ldots$, in which the $n$th figure is $1$ if $n$ is prime, and zero otherwise, represents an irrational number [section 78, page 174]
By the 9th edition, 1944, Gerry Myerson notes the first reference to 1 as prime is removed (I'd bet it was changed by the 7th edition, 1938, and will try to check). The decimal (surely accidentally) was still present in the 10th edition that I checked.
However, I am not convince Hardy personally thought (defined) that 1 was prime in 1921, I suspect he thought it was still not important enough to bother changing what he had written in the first edition, 1908. His comments in the article "The Theory of Numbers" in Science (New Series, Vol. 56, No. 1450, Oct. 13, 1922, pp. 401-405), appears to imply 1 is not prime. E.g., he repeats that Mersenne listed $2^n-1$ was prime for 2, 3, ... without commenting about $1=2^1-1$ or altering Mersenne's statement to start at 1---which was commonly done. (I admit this is this is weak evidence!)
Wikipedia has lots of information on this topic. For example, "Henri Lebesgue is said to be the last professional mathematician to call 1 prime."
Not a historical answer, but...
Ruminations on the "field with one element" are in a sense including 1 (and powers of 1) in the set of prime powers.
Also, in quantum groups (loosely speaking, one-parameter deformations of groups) the $q=1$ limit recovers the group while $q$ a root of unity is related to phenomena in prime characteristic $p$ > 0.
There is also the Krasner - Kazhdan - Deligne philosophy of "fields of characteristic $p$ as limits of fields of characteristic 0", recently and somewhat speculatively related to the field of one element in arxiv papers of Connes and Consani.
1 is prime by Hardy's Theorem 90 (not Hilbert's!), see