This paper proposes a unifying framework, the Three-Factor Framework (TFF), based on the decomposition of Fermat's Little Theorem, for the structural analysis of prime numbers and primality tests. Through the visual representation of Power Tables, the analysis of Quadratic Residues, and the cyclic structure of power sequences, the TFF identifies the internal configuration of primes as a positive discriminant relative to composites, rather than reducing primality to the mere negative connotation of non-divisibility. The framework also provides a complete classification of Fermat Liars into five structural categories, clarifying the mechanisms of success and failure of some FLT-based tests. Two protocols are built on the Fermat decomposition: the Summation test, a diagnostic protocol based on the sum of even powers, exhibiting computational complexity and detection capabilities equivalent to the Miller-Rabin test at cryptographic scales, and the Discriminant Cycle Test, an innovative approach combining primality verification and factorization via the cyclic structure of power sequences. The concluding section explores the foundational implications of the structural richness of primes revealed by the TFF, proposing a vision of prime numbers as entities endowed with an autonomous logical dimension not entirely reducible to the succession of natural numbers. It is hypothesised that PA's inability to distinguish numbers formed through succession from numbers formed according to external encoding schemes and thus the dissimulated coexistence of two rule systems within the same numerical set underlies the structural vulnerability that Gödel exploited to construct the undecidable proposition.
Manuela Doglio (Wed,) studied this question.