

Parity Carpets Correlate by gcd: Four Exact Laws for a Square-Wave Stack
MrlyProd
First published 2026-08-23, revised 2026-09-08
Cut a square into an odd number of equal strips each way, number the strips from zero, and ink every cell whose column and row numbers are both odd. Draw a second such picture at a different scale and hold the two up to the light. How much do they agree? The answer is one exact number built from the greatest common divisor of the two scales, and it is exactly zero when the scales are coprime - not small, not zero to five decimals, zero. So a picture whose scale is prime agrees with every picture before it exactly as much as chance, and you can see which ones those are: they are the white rows.
Write for the square wave and exactly when is odd. The picture above is the carpet field , and everything follows from one integral: for positive integers with , the mean of over the unit interval is when and are both odd, and otherwise.
Theorem. For odd with , the Pearson correlation of the carpets is exactly
which is if and only if , and strictly positive otherwise. The same zero set holds for all four fields the parity rule generates. Hence an odd is prime exactly when its carpet is uncorrelated with every earlier carpet.
The proof is Parseval on the square wave's odd harmonics: enters as and leaves through the odd Basel sum , so every number here is rational. The identity is the odd-harmonic sibling of the classical Franel integral , which the scripts re-check too. The verifier re-derives the master integral by exact rational integration on the lcm grid for every pair up to 40 and every odd pair up to 99 with zero mismatches, confirms that the unqualified law fails on 532 of those first 820 pairs, counts the two-dimensional cell overlaps directly at six scale pairs, and replays the separation over odd from 3 to 199: all 45 primes at exactly 0, all 54 composites strictly positive, the narrowest at with 0.0517383422. The prime criterion is a portrait of coprimality, not a primality test - as an algorithm it is trial division with a picture attached. The paper also computes the stack's whole spectrum: the sine coefficient of the stack at an odd frequency pair is an explicit divisor-sum bracket, the interaction part carrying exactly , and every spectral statistic is a quotient of zeta values in the Estermann-Ramanujan class - with the odd zeta. A stack weighted by renders the divisor function as its spectrum: a Dirichlet series drawn as a picture. The paper also marks where the exactness stops: it does not survive to a hexagonal section, the brightness carries no Mobius information, so no Riemann-hypothesis criterion can be read off it, and the spectrum adds divisor information only - no new L-function appears.