A quick implementation of an Ulam Spiral in Java. The design is based off of Stanislaw Ulam's design - a rectangular grid of numbers, starting with 1 at the center, and spiraling out:
It outputs an image where each number is represented as a pixel. Black if prime and white if composite.