The Beauty of Prime Numbers

  Рет қаралды 38,721

Coder Space

Coder Space

Жыл бұрын

Immerse yourself in the Incredible and Wonderful World of the Beauty of Prime Numbers. This video is an author's exploration of prime numbers using knowledge of the Python language (Pygame, OpenGL)
Source Code (2d visualizations):
drive.google.com/file/d/1AfHV...
Source Code (3d visualizations):
drive.google.com/file/d/1pONB...
Video inspired by this article:
www.cantorsparadise.com/unexp...
#coderspace #primes #primenumbers

Пікірлер: 112
@zack3g
@zack3g Жыл бұрын
The ending looks like the pipe screen savers of the 90s.
@CoderSpaceChannel
@CoderSpaceChannel Жыл бұрын
at first i thought the same 😅
@zack3g
@zack3g Жыл бұрын
@@CoderSpaceChannel There's something really familiar about the movement. Maybe they used primes to drive those pipes.
@CoderSpaceChannel
@CoderSpaceChannel Жыл бұрын
I think it's more based on randomness, with a check for a free direction of movement
@tyjacobs6822
@tyjacobs6822 3 ай бұрын
1:30
@tyjacobs6822
@tyjacobs6822 3 ай бұрын
1:30
@DrGold-ks1mp
@DrGold-ks1mp Жыл бұрын
I can't believe I only just found this channel, it's literally perfectly aligned with my interests. Great video!
@jeffcummings3842
@jeffcummings3842 Жыл бұрын
ditto! Thanks for sharing.
@tyjacobs6822
@tyjacobs6822 3 ай бұрын
0:40
@Jeremy_Moro
@Jeremy_Moro Жыл бұрын
6:02 So that's how grandma made those cool abstract patterns on the carpets. I also realized that you can check if your grandma is good at maths by the patterns of her carpets! That's just amazing! 👍😎
@SeanStClair-cr9jl
@SeanStClair-cr9jl Жыл бұрын
DAAAAAAAMN bro. DAMN. Not only did you create a really nice video (love how specific you were with how you implemented things), but that ending structure is fucking INSPIRED lol. Like... what does that shape look like once it is "finished" haha.... damn. So curious. It would be mind-blowing if it somehow returned to the start :P but that seems impossible. So many interesting mathematical implications from a generation like that; I hope someone dedicates more study to your creation!
@j2sk
@j2sk Жыл бұрын
I would love to see a continuation of that last test, where a function can detect if any cube (at all) overlaps with one another (by a %) and adds into a counter. Anyway, very interesting to see all the visualizations especially in 3D
@Chickenwing38nigeria
@Chickenwing38nigeria Жыл бұрын
I'm currently binge watching all of your videos, love it!!
@fredg8328
@fredg8328 2 ай бұрын
Fun fact: get rid of prime numbers and simply play with XOR and OR functions and you will see Sierpinsky triangles appear. In fact it appears in various places when you play with datas like in the "chaos game" or the blood rhesus table.
@redhen
@redhen Жыл бұрын
Prime pipe maze? Prime-steering-informed architecture? Wonderful video. The Sierpinski triangles mind-blowing. Where did they come from?!
@CoderSpaceChannel
@CoderSpaceChannel Жыл бұрын
it is everywhere, I also generated this triangle with the chaos method, with the help of l-systems and now prime numbers
@experimenteeer
@experimenteeer 9 ай бұрын
It took me a while, but the triangle fractal makes a lot of sense. When you bitwise OR your coordinates you will get repeating sections of odd numbers divided into chunks of powers of 2. What is interesting is that a large number of coordinates are prime numbers.
@tagberli
@tagberli Жыл бұрын
Found this channel and I want to say that it's amazing, truly fascinating world of visualizing math
@alvarocubi
@alvarocubi Жыл бұрын
Great video, the script really showed your passion for this topic
@jermania7467
@jermania7467 Жыл бұрын
Awesome skills. First thought that came to mind on your rendition was Labyrinth. It reminded me of the movie the Labyrinth with all the twisting pathways that lead in all directions.
@graxxarecords3456
@graxxarecords3456 Жыл бұрын
Truly a mentor. thanks for the video, superb, watched the whole thing!
@cesarrojas6744
@cesarrojas6744 Жыл бұрын
It's amazing how well done this video is.
@antonyshakesby4368
@antonyshakesby4368 Жыл бұрын
Amazing. Really enjoyed this one!
@JaskaranSingh-im5hw
@JaskaranSingh-im5hw Жыл бұрын
Very interesting take on prime numbers visualizations!
@aariskazi9002
@aariskazi9002 Жыл бұрын
Love your work and presentation
@duoc-moi
@duoc-moi 2 ай бұрын
So beautiful!
@jac556
@jac556 11 ай бұрын
This is amazing. Thank you for sharing!
@jakubkoscioek8637
@jakubkoscioek8637 Жыл бұрын
That’s something I saved and I will be coming back to. So much hard work and great job done by you! Congratulations. I will be sharing this video to all my friends
@Holonet01
@Holonet01 Жыл бұрын
"Prime Ladder" kinda pops into my head. Or, that scene on the rooftops in Mary Poppins where she forms the smoke into steps and they walk up... but in 3D 😁
@FunWithBits
@FunWithBits 3 ай бұрын
This is really awesome! I have made 2-d prime structures in the past also but never 3d.
@mayankkashyap1877
@mayankkashyap1877 Жыл бұрын
Awesome video, This video inspired me to make my own engine and code conways game of life algo to visualize the mathematical models. I will try to play around with the rules and lets see what I witness.
@jerryiuliano871
@jerryiuliano871 10 ай бұрын
The hexagon spiral for primes uses this formula: .75*x^2 + 1.5*x + 23 = mostly prime numbers when x is an even number.
@mohamedcherifi5376
@mohamedcherifi5376 Ай бұрын
Thats just amazing 😍😍😍
@DaRza17
@DaRza17 10 ай бұрын
Stunning stuff here... for a beginner programmer and someone who used to hate maths this is just way beyond me.
@Matematica_Aplicada
@Matematica_Aplicada Жыл бұрын
Amazing video!!!
@ArashRabbani
@ArashRabbani Жыл бұрын
Amazing videos indeed. You deserve milloins of subs :)
@taylor.matson
@taylor.matson 2 ай бұрын
Cool video and nice bg music :)
@thefootles
@thefootles Жыл бұрын
This channel is going to get very big!
@philtoa334
@philtoa334 Жыл бұрын
Beautiful.
@SkyFly19853
@SkyFly19853 Жыл бұрын
Truly nice.
@MrBrassmonkey12345
@MrBrassmonkey12345 9 ай бұрын
Why is this so insanely good?
@mayankbhaisora2699
@mayankbhaisora2699 Жыл бұрын
Man this is so cool
@cooksoni.a
@cooksoni.a 23 күн бұрын
This is amaze, and it is awesome/amazing. It is beautiful and incredible, and it is amazing.
@MarioAbbruscato
@MarioAbbruscato Жыл бұрын
infinite amazement
@code-dredd
@code-dredd Жыл бұрын
*Some People:* There's no evidence of design in nature. *Prime Numbers:*
@leandrogregorio8801
@leandrogregorio8801 Жыл бұрын
Very interesting
@palasaripasar836
@palasaripasar836 Жыл бұрын
You 're expert in python. It's amazing..
@dimitriosdesmos4699
@dimitriosdesmos4699 Жыл бұрын
great stuff
@SCOA57KrutikaAhire-en1ob
@SCOA57KrutikaAhire-en1ob 4 ай бұрын
wooow glad i found my people in this comment section .. not everyone is this excited to watch such stuff
@sumongus
@sumongus Жыл бұрын
An easier way to tell if a natural number n is prime is to calculate ((n-1)!+1)/n. If the result is an integer, then n is prime (or 1). Otherwise, n is composite.
@CoderSpaceChannel
@CoderSpaceChannel Жыл бұрын
I have tested this and in terms of performance, using Wilson's theorem is a "less" efficient method for checking prime numbers (even if you cache the factorial values)
@killereks
@killereks Жыл бұрын
sounds incredibly inefficient for large n values
@simonstrandgaard5503
@simonstrandgaard5503 5 ай бұрын
Regarding the 3d random walk, does it intersect with itself? Beautiful visualizations.
@djohnsto2
@djohnsto2 Ай бұрын
That's pretty cool! I wonder what it would look like to use randomly selected odd numbers instead of primes - Would you still get the fractal triangles and other patterns?
@leewriter4656
@leewriter4656 Жыл бұрын
I wanna do something like this in Unity 3d. How awesome would it be if the player had a say in how his path is unfolded.
@evanbarnes9984
@evanbarnes9984 Жыл бұрын
I think you need to call the final render the Number Pipeline! An homage to the early screensaver
@yaqult3108
@yaqult3108 Жыл бұрын
hi !! I love you're videos, I tried running the code but I keep getting the error self.position = glm.vec3(position) AttributeError: module 'glm' has no attribute 'vec3' Do you know how to fix this?
@CoderSpaceChannel
@CoderSpaceChannel Жыл бұрын
You may have installed the wrong glm module. Check: pip install PyGLM
@UZPRO11
@UZPRO11 Жыл бұрын
best of best
@kalebpierson1262
@kalebpierson1262 7 ай бұрын
Do the last one again. But instead have it go only right at the number in between twin primes. Then have it alternate from left to right at the number in between twin primes. Look at it then. I did this in on paper and it was pretty cool. Would like to see it in three 3d also at the number in between the twin primes.
@Temu_ko
@Temu_ko Жыл бұрын
there exists chains of consecutive numbers without prime numbers of arbietrary lengh. So the "prime laberynth" can have columns in one direction arbitraery large
@acle_
@acle_ Жыл бұрын
im wondering if the final structure ever self-intersects
@MrKasenom
@MrKasenom Жыл бұрын
the final prime number structure you made reminds me of random walks
@tudastar4646
@tudastar4646 10 ай бұрын
Please more 3D number patterns !
@mikefromspace
@mikefromspace 7 ай бұрын
A name for your block maze? How 'bout the endless Minecraft dungeon? It would need a world higher than 256 though haha
@SimplexonYt
@SimplexonYt 10 ай бұрын
ill call the number line a Prime Spagetti
@eggs-istangel4232
@eggs-istangel4232 Жыл бұрын
Why are you checking for prime number from 3 up untill square root of entered number? What's the math behind it?
@CoderSpaceChannel
@CoderSpaceChannel Жыл бұрын
If a number n is not a prime, it can be factored into two factors a and b: n = a * b Now a and b can't be both greater than the square root of n, since then the product a * b would be greater than sqrt(n) * sqrt(n) = n. So in any factorization of n, at least one of the factors must be smaller than the square root of n, and if we can't find any factors less than or equal to the square root, n must be a prime.
@xjuhox
@xjuhox Жыл бұрын
It's the _Prime snake_ 🐍 Btw., could it be possible to change the turn in accordance with the distance difference to the previous and next prime?
@wagdan79
@wagdan79 6 ай бұрын
The 2d-version works perfectly The 3d-version gives me only a black screen/black window. I think it relates to pygame. I can't find a solution. Do you have a suggestion?
@irigima9974
@irigima9974 5 ай бұрын
A serious question: Does anyone know that there is a pattern in factorials of all N ? (N being all numbers inclusive of primes) I have found it. Anyone interested - let me know.
@micahcarr2085
@micahcarr2085 Жыл бұрын
I truly believe that the universe is a holographic reflection of the matrix of mathematics :3 Also maybe 🤔 you could call it a Prime Snake or Snake-map or Snake trailing?
@anypuppet
@anypuppet Жыл бұрын
Three letters: WOW🎉
@bujitself
@bujitself Жыл бұрын
Prime pipes. Cuz that reminds me of a Windows screensaver
@gokusupersaiyan6
@gokusupersaiyan6 Жыл бұрын
I saw a small man holding a gun in your wallpaper :D @07:01
@tokajileo5928
@tokajileo5928 6 ай бұрын
I programmed in pascal and c/c++ but this programming language seems way complicated for me.
@PanWojtek
@PanWojtek Жыл бұрын
we have great ways to visualize prime numbers, but we still can't derive the formula for n primes
@geko2867
@geko2867 Жыл бұрын
You ever see a new visualization following rules with basic maths and wonder if you're looking at the core logic of the universe unfold before you?
@kimeg7294
@kimeg7294 Жыл бұрын
Do you plan to share code .. For educational purposes?
@CoderSpaceChannel
@CoderSpaceChannel Жыл бұрын
A link to the source code (for 2d) is available in the video description
@ahole5407
@ahole5407 7 ай бұрын
I will pay money to have you work on a project with me. Been working with primes for years and need a visualization in both 2 and 3D
@mzakyr342
@mzakyr342 Жыл бұрын
The end i think its should be prime line or line of the prime
@carlfranz6805
@carlfranz6805 Жыл бұрын
Call your discovery 'Bob'. It's short, a palindrome, and dyslexic friendly. 🤣😎
@Terandium
@Terandium Жыл бұрын
Why robot voice :c other than that cool video
@electrictrojan6719
@electrictrojan6719 Жыл бұрын
What's the music name?
@CoderSpaceChannel
@CoderSpaceChannel Жыл бұрын
Traversing - Godmode
@perpetualrabbit
@perpetualrabbit Ай бұрын
name for map of numbers: Prime Chart,
@tamadaanilkumar4738
@tamadaanilkumar4738 Жыл бұрын
I bet u all took a few screenshots of these patterns
@jankucera8505
@jankucera8505 Жыл бұрын
make an infinite game based on it
@frankconley7630
@frankconley7630 Жыл бұрын
Prime track.
@damianojeda938
@damianojeda938 3 ай бұрын
is 1 not considered prime?
@thecoolcongle5128
@thecoolcongle5128 28 күн бұрын
I think it's useful for one to not be considered prime
@shivangyadav5887
@shivangyadav5887 Жыл бұрын
I am scared
@nguyenthai3140
@nguyenthai3140 3 ай бұрын
????
@SlinkyD
@SlinkyD Жыл бұрын
Prime Sierpenski Lattice
@jackchampagne.r
@jackchampagne.r Жыл бұрын
Source code?
@CoderSpaceChannel
@CoderSpaceChannel Жыл бұрын
A link to the source code (for 2d) is available in the video description
@jackchampagne.r
@jackchampagne.r Жыл бұрын
@@CoderSpaceChannel Thanks! No source for 3d?
@CoderSpaceChannel
@CoderSpaceChannel Жыл бұрын
added, link available in description
@tamphex
@tamphex Жыл бұрын
rEvEnGe 0f Th3 N3RdZ
@helpeytb
@helpeytb 7 ай бұрын
6:41 no we actually do live on a simulation due to me seeing some weird syit happening with balls
@helpeytb
@helpeytb 7 ай бұрын
The proof is due to the balls NOT THE SIMULATION
@VoidWasHere._.
@VoidWasHere._. Жыл бұрын
First
@akin.kilic.
@akin.kilic. Жыл бұрын
For some reason, this makes me feel insignificant.
@dclxviclan
@dclxviclan Жыл бұрын
Let's start learn Math 👽
@soulblade9142
@soulblade9142 Жыл бұрын
pipes
@landojefferson7215
@landojefferson7215 Жыл бұрын
Great experiments, very interesting and informative. Though, if I could make a suggestion? Just get a mic and record your real voice bro, I can't stand that AI generated robo voice in this. It's not convincing in the slightest, no emotional infliction, dehumanized quantization in the timing. Nobody annunciates words that precise, but I'll admit AI voices are indeed improving.
@fuzzyelectrons
@fuzzyelectrons 8 ай бұрын
Fun video, however, the patterns you see when you apply the xor and or operations has nothing to do with prime numbers. If you change your isPrime function to something completely different that will return true/false in a deterministic way, you will still see interesting patterns. To be sure, I tested this myself and even with a function as simple as isPrime(x) { return ((x % 14) == 0); }, I got complex structures, very similar to what you got using prime numbers.
@Slaygee
@Slaygee Жыл бұрын
what
@yurisich
@yurisich Жыл бұрын
You should consider applying these voxel renderings to a cube of rgb color space en.wikipedia.org/wiki/RGB_color_model#Geometric_representation keep up the awesome work
Procedural 3D Engine. Ray Marching OpenGL Tutorial
15:31
Coder Space
Рет қаралды 34 М.
In 2003 We Discovered a New Way to Generate Primes
22:17
Eric Rowland
Рет қаралды 395 М.
Slow motion boy #shorts by Tsuriki Show
00:14
Tsuriki Show
Рет қаралды 9 МЛН
Secret Experiment Toothpaste Pt.4 😱 #shorts
00:35
Mr DegrEE
Рет қаралды 19 МЛН
НРАВИТСЯ ЭТОТ ФОРМАТ??
00:37
МЯТНАЯ ФАНТА
Рет қаралды 7 МЛН
Dijkstra's Hidden Prime Finding Algorithm
15:48
b001
Рет қаралды 161 М.
Twin Prime Conjecture - Numberphile
17:42
Numberphile
Рет қаралды 783 М.
The Rhythm of The Primes #some2
10:12
Marc Evanstein / music․py
Рет қаралды 873 М.
Quest To Find The Largest Number
11:43
CodeParade
Рет қаралды 279 М.
The Reciprocals of Primes - Numberphile
15:31
Numberphile
Рет қаралды 1,6 МЛН
The Bubble Sort Curve
19:18
Lines That Connect
Рет қаралды 499 М.
How prime numbers protect your privacy #SoME2
13:25
NamePointer
Рет қаралды 10 М.
The Prime Number Race (with 3Blue1Brown) - Numberphile
20:29
Numberphile
Рет қаралды 381 М.
10 FORBIDDEN Sorting Algorithms
9:41
Ardens
Рет қаралды 824 М.
the beauty of prime numbers in cryptography
4:36
Jeffrey Ventrella
Рет қаралды 12 М.
Slow motion boy #shorts by Tsuriki Show
00:14
Tsuriki Show
Рет қаралды 9 МЛН