Patterns formed by chains of magnetic beads