abstract: For any polynomials P1, ..., Pn in the polynomial ring ZX_1, ..., X_m we construct a continuous time dynamical system whose periodic orbits come in compact packets that are in bijection with the maximal ideals of the ring R = ZX_1, ..., X_m(P1,...Pn). All periodic orbits in a given packet have the same length equal to the logarithm of the order of the residue field of the corresponding maximal ideal. For R = Z we get a dynamical system whose periodic orbits are closely related to the prime numbers. The construction works in the greater generality of integral normal schemes and uses new ringed spaces which are constructed from rational Witt vector rings. In the zero-dimensional case there is a close relation to work of Kucharczyk and Scholze who realized certain Galois groups as étale fundamental groups of ordinary topological spaces. A p-adic variant of our construction turns out to be closely related to the Fargues-Fontaine curve of p-adic Hodge theory