In self-organizing systems such as collective intelligent behaviors of animal or insect groups: flocks of birds, colonies of ants, schools of fish, swarms of bees, etc. there are ever emergent patterns which cannot be reduced to a linear composition of elementary subsystems properly. This reduction is possible only due to many repellents and an artificial environment. The emergent patterns are studied in the so-called swarm intelligence. In this paper we show that any swarm can be represented as a conventional automaton such as Kolmogorov-Uspensky machine, but with a very low accuracy because of deleting emergent phenomena. Furthermore, we show as well that implementing some unconventional algorithms of p-adic arithmetic and logic are much more applicable than conventional automata. By using p-adic integers we can code different emergent patterns.