Using trigonometric properties, in particular sums of squares of sines and cosines, a primality-testing formula is obtained, consisting only of elementary functions and not based on Wilson’s theorem.
Enrico P. G. Cadeddu (Sun,) studied this question.