Beguilingly simple and yet painfully, frustratingly complex at the same time, there are few things in mathematics as fascinating as the primes: numbers that cannot be divided by any integers except themselves and one. And, as with so much in number theory, the scariest problem of all is one that sounds, on the face of it, almost childishly straightforward: what pattern – if any – do the prime numbers follow?

It's not an easy question. Since Eratosthenes first invented his sieve back in the 3rd century BCE, some of the greatest mathematical minds have thrown up their hands and declared it unanswerable. The best we've got is the famous Riemann hypothesis, which says that the primes follow a pattern closely related to the Riemann zeta function. The hypothesis may well be true – many mathematicians, often a romantic bunch, feel it's just too beautiful *not* to be true – but in the 160 years since Riemann first proposed it, nobody has yet been able to come up with a proof.

But maybe all is not lost. A new analysis from researchers in the departments of chemistry, materials science, and mathematics at Princeton University has revealed something amazing: a level of order in the primes that nobody knew anything about until now. Their results are published in the Journal of Statistical Mechanics: Theory and Experiment.

"We showed that the primes behave almost like a crystal," explained lead researcher Salvatore Torquato in a statement about the discovery. "[M]ore precisely, similar to a crystal-like material called a ‘quasicrystal.’"

Now, quasicrystals are structures like crystals, but without translational symmetry – the patterns of their atomic arrangements will never repeat. In very crude terms, it looks like a crystal, but only if you squint.

The discovery of quasicrystals in 1982 by materials scientist Dan Shechtman was marked by some incredible controversy. But despite being ridiculed by his peers as a "quasi-scientist" and told he had become "a disgrace", his work on the "impossible" structures proved so significant that he was awarded the Nobel Prize in Chemistry in 2011. Since then, quasicrystals have promised advances on everything from frying pans to real-life *Terminator* robots – and now, Torquato and his colleagues say we can add prime numbers to that list.

The key is something called hyperuniformity. This somewhat brain-twisting property has been found in situations as diverse as the retinal cells of chickens or the large-scale structure of the universe since it was first observed in the early 2000s – and Torquato's team has shown it applies to the Riemann hypothesis as well. Put crudely, it refers to when seemingly random things turn out to have a kind of hidden order – for instance, imagine a bag of trail mix: if you inspect each grain or cashew individually, you're not going to see a pattern. But scale it up to a family-size pack in the store, and you can see a sort of sense: the random vibrations and bumps have shaken the particles serendipitously into an arrangement that fits every nook and cranny almost perfectly. And it's that "zooming out" technique that explains the Princeton team's result.

"[W]hen considered over large swaths of the number line, prime numbers are more ordered than previously believed," explains the statement. "[A]lthough primes appear random over short intervals... at sufficiently long stretches of the number line, sense can be made out of otherwise seemingly chaotic numbers."

Amazingly, the researchers first demonstrated this result back in February with a surprisingly concrete experiment. By shining X-rays through quasicrystals – Torquato's specialty – the team analyzed the resulting patterns of bright spots, known as Bragg's peaks. When an X-ray is shone through a crystal, these patterns will be periodic and predictable – but shine it through a *quasi*crystal and something bizarre happens: the resulting peaks occur in a pattern strikingly similar to the prime numbers. It's only now, however, using techniques from number theory, that the team have been able to explain the unexpected phenomenon.

"What’s fascinating about this paper is that it gives us a different perspective on the primes: instead of viewing them as numbers, we can view them as particles and try to map out their structure via X-ray diffraction," remarked Henry Cohn, a principal researcher at Microsoft Research who was not involved in the study. "It’s a beautiful new perspective on this information, and it opens up new connections with materials science and scattering theory."

The team hope their results may be useful in both materials science and mathematics. And, although it may not win them the million-dollar prize, it's no doubt exciting that a result like this can appear in such an apparently unrelated discipline.

But perhaps we shouldn't be so surprised after all – as the number theorist Carl Pomerance once said: "** God may not play dice with the universe – but something strange is going on with the prime numbers.**"