# "Prime Remainders" visualization

**URL:** <https://community.wolfram.com/t/prime-remainders-visualization/7148>\
**Category:** Ideas\
**Tags:** graphics-and-visualization\
**Created:** [November 8, 2015, 11:13pm UTC](https://community.wolfram.com/t/prime-remainders-visualization/7148 "2015-11-08T23:13:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vitaliyk](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/vitaliyk/32/45591_2.png) [@Vitaliyk](https://community.wolfram.com/u/Vitaliyk)\
**Post date:** [November 8, 2015, 11:13pm UTC](https://community.wolfram.com/t/prime-remainders-visualization/7148/1 "2015-11-08T23:13:52Z")

</div>

I was pointed out to the J-Blog’s post: [Prime Remainders](https://jonathanfrech.wordpress.com/2015/11/07/prime-remainders/). From the blog:

> This program calculates primes, takes their remainder and then places a color accordingly. The formular for the color c at prime p with modulo m is c = p mod m.

It is a one-liner in Wolfram Language:

```
ArrayPlot[Partition[Mod[Prime[Range[350^2]], 450], 350]]

```

 ![SF43DFGQ345GEFDA.png](https://global.discourse-cdn.com/wolfram/original/3X/e/f/ef5079fe3154fb0da2d5a10a611955e61fbcab61.png)

Reproducing the original color scheme is simple:

```
ArrayPlot[Partition[Mod[Prime[Range[350^2]], 450], 350], ColorFunction -> (Blend[{Black, Red}, #] &)]

```

 ![sdf343greavdfsfd.png](https://global.discourse-cdn.com/wolfram/original/3X/4/c/4c2cc0072e7925b579fe1b74f0eaa7bf50f736df.png)

And the app:

```
Manipulate[ArrayPlot[Partition[Mod[prm, mod], 100], ColorFunction -> (Blend[{Black, Red}, #] &)],
 {{prm, Prime[Range[10^4]]}, None}, {{mod, 250}, 3, 1000, 1}]

```

![dsf435hrst5q4hrbavds.gif](https://global.discourse-cdn.com/wolfram/original/2X/e/eb2ac31fea7b13cef389b9b55662e292cd1f82bb.gif)

I would recommend checking out New Kind of Science book especially [Chapter 4: Systems Based on Numbers](http://www.wolframscience.com/nksonline/chapter-4) for many interesting patterns generated by numbers.
