If you want a strong magnet, the obvious answer is to buy one. However, for a variety of reasons, you might want to combine several smaller magnets. There are a few ways to do this, but the Halbach array, as [wannabemadsci] explains, allows you to make an array of magnets where one side is very strong, and the other side is very weak.
The example uses a 3D-printed housing and five cube magnets. To form a Halbach array, the poles of the magnets are in a specific orientation that effectively rotates ninety degrees for each — in this case — cube.
The fields add and cancel each other so that you get the most magnetic lines of force on one side and very few on the other side. This might seem like a curiosity, but there are a range of practical applications. Maglev trains are one example. Brushless motors and free electron lasers can take advantage of the effect, too.
You can also have a halbach cylinder with all the magnetic flux inside the ring and practically none outside. You can read more about the math and applications on Wikipedia. If you think cylinders sound familiar, maybe you are thinking about core memory. Don’t understand magnets? We aren’t sure anyone understands them completely, but we try.