Since Stark's nice book "An Introduction to Number Theory" was mentioned, I would like to call attention to a passage on p.6:
Twenty-five centuries ago, the Chinese gave what they believed was an infallible rule for determinging primality. Their rule stated that n is a prime if and only if
n | (2^n - 2).
Years ago, I vaguely recall *hearing* attribution of the same sort. This was the first time I have seen such an attribution in writing. I had asked Stark if he could give me a hint about the origin of this 'assertion'. So far, I have received no reply.
As far as I know, about the only math text from China that might qualify to 25 centuries ago would be Chou Pei Suan Ching. This dealt mostly with astronomy, divination, and theorem of Pythagoras.
[Unfortunately, I do not have access to a copy.]
I do not believe that the concept of a *prime* number existed in Chinese mathematics until much later. I wonder if some members of the list could enlighten me on this point--in private, since questions about history of Chinese mathematics may not be of broad interest.