TOPICS
Search

Prime Number Art


Prime number art in the form of ASCII art arranges the digits of a single prime number in rows to form a picture (May 2017). Reading the rows from top to bottom and each row from left to right recovers the decimal expansion of the prime number.

One way to make such a picture is to use digits of different visual weights, such as 1 for a light pixel and 8 for a dark one. A primality test can then be applied to the resulting integer. If it is composite, varying a few digits while keeping the picture recognizable provides more candidates to test (May 2017).

PrimeNumberArt

The illustrated Pi Day design by R. Baillie (pers. comm. to D. Lichtblau, Feb. 23, 2026) has 17 rows of 72 digits. The 1224-digit prime number contains 954 ones, 269 eights, and one zero. Replacing the zero with an eight would give a digit sum of 3114 and make the resulting integer a multiple of 3. With the zero, the digit sum is 3106.


See also

Digit Sum, Primality Test, Prime Number, Primes with Restricted Digits

Explore with Wolfram|Alpha

References

May, J. "Is This the Most Maple Prime Post Ever on MaplePrimes?" MaplePrimes, Sep. 14, 2017. https://mapleprimes.com/maplesoftblog/208543-Is-This-The-Most-Maple-Prime-Post-Ever.

Cite this as:

Weisstein, Eric W. "Prime Number Art." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/PrimeNumberArt.html

Subject classifications