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.
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.
After this very appealing and funny question, I wanted to see :
Well as this stage I wanted to create a little cli
that should
graphml
file as output so we can play with it laterFinally, here is the JBang! program you can easily call this way :
jbang https://github.com/adriens/truncatable-primes/blob/main/BigTruncatablePrimes.java -s 30
A proto around Truncatable primes
jbang https://github.com/adriens/truncatable-primes/blob/main/BigTruncatablePrimes.java -s 30
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.
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.
3
and 7
seeded galaxies
3
galaxy
You can use the ready to use graphml and make your own visualizations, and contribute them to the repo.
Stay curious, experiment things and have fun.