As you look at the density plots of increasing numbers of prime gaps (the distance between subsequent primes), a fractal emerges. Just get the gaps and graph the densities with this simple R code:

1 2 3 4 5 6 7 8 9 |
library(primes) max <- 100 p <- generate_primes( min = 0, max ) gaps <- p[ 2 : length(p) ] - p[ 1 : length(p) - 1 ] plot( density(gaps), xlab = 'prime gaps', main = 'Below 100' ) |

For increasing numbers of gaps (shown to 100_000_000), this results in the following graphs. You can see the self-similar, fractal […]