π Intro
As mentionned in my previous post...
About the Collatz conjecture, Neo4J & cypher
adriens γ» Sep 7 '21 γ» 6 min read
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
adriens / truncatable-primes
A proto around Truncatable primes
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.
π Artwork samples
Twin 3
and 7
seeded galaxies
The 3
galaxy
Circular layout
Do your own visualizations
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.
Top comments (0)