## DEV Community is a community of 871,688 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Posted on

# 357686312646216567629137

## π Intro

As mentionned in my previous post...

I'm a big fan of Numberphile, and recently I felt on this one :

In a few words, the question is :

What is the biggest prime number we can build, which has the following property : "each time we remove a digit from the left side we still get a prime number."

Obviously, the answer is quite straightworward :

Yes it does exist, and it is and the biggest one is `357686312646216567629137`. That's all.

## β The questions

After this very appealing and funny question, I wanted to see :

• I want to compute it (and generate some additional stuff)
• What does the structure of the prime numbers ? I mean : what does it look like... as graph ?

## π» Compute it

Well as this stage I wanted to create a little `cli` that should

• Take a number of generations as input : the bigger the further I'm looking for such primes
• Draw the output in the console the funny way so we can see the strange thing appear π
• Dump a `graphml` file as output so we can play with it later

Finally, here is the JBang! program you can easily call this way :

``````jbang https://github.com/adriens/truncatable-primes/blob/main/BigTruncatablePrimes.java -s 30
``````

# truncatable-primes

A proto around Truncatable primes

``````jbang https://github.com/adriens/truncatable-primes/blob/main/BigTruncatablePrimes.java -s 30
``````

# Why

Because of this great Numberphile episode.

Which looks like that with a maximum number of generations set to `30` :

At then end of the run, you get a `.graphml`. So we can now play with it.

## π¨Dealing with `Gephi`

Gephi is an amazing tool to deal with graphs, for analytics purpose, or simply to produce satisfying artworks.

Then I started to play with it, and produced somes. See below some of my favorites.