We discover a novel characterization of prime numbers through the periodic behaviour of the linear recurrence a(n) = −a(n−1) + a(n−2) + a(n−3) modulo m. We conjecture that the normalized sum of lengths of palindromic cycles equals 1 if and only if m ≥ 2 is prime. For semiprime and prime power moduli, we derive explicit weight formulas involving Gaussian q-binomial coefficients, and conjecture a weight preservation property analogous to that observed in Fibonacci-type recurrences. Additionally, we investigate the distribution of absolute minima under random initialization, revealing a reflection symmetry P(n) = P(2 − n) and fractal boundary structures in parameter space.
Marc T. Pudelko (Tue,) studied this question.