Many natural patterns and shapes, such as meandering coastlines, clouds, or turbulent flows, exhibit a characteristic complexity that is mathematically described by fractal geometry. Here, we extend the reach of fractal concepts in photonics by experimentally demonstrating multifractality of light in arrays of dielectric nanoparticles that are based on fundamental structures of algebraic number theory. Specifically, we engineered novel deterministic photonic platforms based on the aperiodic distributions of primes and irreducible elements in complex quadratic and quaternions rings. Our findings stimulate fundamental questions on the nature of transport and localization of wave excitations in deterministic media with multi-scale fluctuations beyond what is possible in traditional fractal systems. Moreover, our approach establishes structure–property relationships that can readily be transferred to planar semiconductor electronics and to artificial atomic lattices, enabling the exploration of novel quantum phases and many-body effects.