  We report a rigorous theory to show the origin of the unexpected periodic
behavior seen in the consecutive differences between prime numbers. We also
check numerically our findings to ensure that they hold for finite sequences of
primes, that would eventually appear in applications. Finally, our theory
allows us to link with three different but important topics: the
Hardy-Littlewood conjecture, the statistical mechanics of spin systems, and the
celebrated Sierpinski fractal.
