The interplay between the topology of cortical circuits and synchronized activity modes in distinct cortical areas is a key enigma in neuroscience. We examined the relation between the stable synchronized activity modes and network connectivity using a Hodgkin-Huxley based, brain dynamics model. Simulations indicate that small motifs exhibit different synchronization modes depending on their local parameters. Thus the activity of a complex network composed of interconnected motifs cannot be extracted from the activity mode of each individual motif and is governed by local parameters. We demonstrate that the mechanism governing the synchronized activity modes in neural networks is the greatest common divisor of network loops. The synchronized mode and the transients to synchronization pinpoint the type of external stimuli. These analytic results are supported by in vitro experiments of dynamic clamp method on cultured cortical cells, simulations of neural networks, simulations of chaotic maps, self-consistent and mixing arguments as well as analytical solutions of Bernoulli maps. Our findings call for reexamining sources of correlated activity in cortex and suggest that synaptic alternations that can induce transition between decaying and sustained activity may serve as a remote switching mechanism.