The Beauty of Prime Numbers

Поділитися
Вставка
  • Опубліковано 15 жов 2022
  • 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

КОМЕНТАРІ • 105

  • @zack3g
    @zack3g Рік тому +59

    The ending looks like the pipe screen savers of the 90s.

    • @CoderSpaceChannel
      @CoderSpaceChannel  Рік тому +10

      at first i thought the same 😅

    • @zack3g
      @zack3g Рік тому +6

      @@CoderSpaceChannel There's something really familiar about the movement. Maybe they used primes to drive those pipes.

    • @CoderSpaceChannel
      @CoderSpaceChannel  Рік тому +7

      I think it's more based on randomness, with a check for a free direction of movement

    • @tyjacobs6822
      @tyjacobs6822 17 днів тому

      1:30

    • @tyjacobs6822
      @tyjacobs6822 17 днів тому

      1:30

  • @DrGold-ks1mp
    @DrGold-ks1mp Рік тому +66

    I can't believe I only just found this channel, it's literally perfectly aligned with my interests. Great video!

  • @SeanStClair-cr9jl
    @SeanStClair-cr9jl Рік тому +18

    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!

  • @Jeremy_Moro
    @Jeremy_Moro Рік тому +6

    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! 👍😎

  • @j2sk
    @j2sk Рік тому +8

    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 Рік тому +3

    I'm currently binge watching all of your videos, love it!!

  • @duoc-moi
    @duoc-moi 2 дні тому

    So beautiful!

  • @redhen
    @redhen Рік тому +10

    Prime pipe maze?
    Prime-steering-informed architecture?
    Wonderful video. The Sierpinski triangles mind-blowing. Where did they come from?!

    • @CoderSpaceChannel
      @CoderSpaceChannel  Рік тому +8

      it is everywhere, I also generated this triangle with the chaos method, with the help of l-systems and now prime numbers

  • @tagberli
    @tagberli Рік тому +3

    Found this channel and I want to say that it's amazing, truly fascinating world of visualizing math

  • @akin.kilic.
    @akin.kilic. Рік тому +3

    For some reason, this makes me feel insignificant.

  • @alvarocubi
    @alvarocubi Рік тому +2

    Great video, the script really showed your passion for this topic

  • @jermania7467
    @jermania7467 Рік тому +1

    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.

  • @cesarrojas6744
    @cesarrojas6744 Рік тому +1

    It's amazing how well done this video is.

  • @DaRza17
    @DaRza17 7 місяців тому

    Stunning stuff here...
    for a beginner programmer and someone who used to hate maths this is just way beyond me.

  • @jac556
    @jac556 8 місяців тому

    This is amazing. Thank you for sharing!

  • @JaskaranSingh-im5hw
    @JaskaranSingh-im5hw Рік тому +2

    Very interesting take on prime numbers visualizations!

  • @graxxarecords3456
    @graxxarecords3456 Рік тому +2

    Truly a mentor.
    thanks for the video, superb, watched the whole thing!

  • @Holonet01
    @Holonet01 Рік тому +1

    "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 😁

  • @antonyshakesby4368
    @antonyshakesby4368 Рік тому +1

    Amazing. Really enjoyed this one!

  • @aariskazi9002
    @aariskazi9002 10 місяців тому +1

    Love your work and presentation

  • @experimenteeer
    @experimenteeer 6 місяців тому +2

    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.

  • @jakubkoscioek8637
    @jakubkoscioek8637 Рік тому +2

    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

  • @jerryiuliano871
    @jerryiuliano871 7 місяців тому

    The hexagon spiral for primes uses this formula:
    .75*x^2 + 1.5*x + 23 = mostly prime numbers when x is an even number.

  • @ArashRabbani
    @ArashRabbani Рік тому +1

    Amazing videos indeed. You deserve milloins of subs :)

  • @mayankkashyap1877
    @mayankkashyap1877 Рік тому +1

    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.

  • @thefootles
    @thefootles Рік тому +1

    This channel is going to get very big!

  • @FunWithBits
    @FunWithBits 22 дні тому

    This is really awesome! I have made 2-d prime structures in the past also but never 3d.

  • @tudastar4646
    @tudastar4646 7 місяців тому

    Please more 3D number patterns !

  • @code-dredd
    @code-dredd Рік тому +3

    *Some People:* There's no evidence of design in nature.
    *Prime Numbers:*

  • @philtoa334
    @philtoa334 Рік тому

    Beautiful.

  • @Matematica_Aplicada
    @Matematica_Aplicada Рік тому +1

    Amazing video!!!

  • @simonstrandgaard5503
    @simonstrandgaard5503 2 місяці тому

    Regarding the 3d random walk, does it intersect with itself?
    Beautiful visualizations.

  • @MrBrassmonkey12345
    @MrBrassmonkey12345 6 місяців тому

    Why is this so insanely good?

  • @SkyFly19853
    @SkyFly19853 Рік тому

    Truly nice.

  • @MarioAbbruscato
    @MarioAbbruscato Рік тому +1

    infinite amazement

  • @MrKasenom
    @MrKasenom Рік тому

    the final prime number structure you made reminds me of random walks

  • @mayankbhaisora2699
    @mayankbhaisora2699 Рік тому

    Man this is so cool

  • @palasaripasar836
    @palasaripasar836 Рік тому

    You 're expert in python. It's amazing..

  • @yaqult3108
    @yaqult3108 Рік тому +1

    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  Рік тому +1

      You may have installed the wrong glm module. Check:
      pip install PyGLM

  • @evanbarnes9984
    @evanbarnes9984 Рік тому

    I think you need to call the final render the Number Pipeline! An homage to the early screensaver

  • @leewriter4656
    @leewriter4656 Рік тому +1

    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.

  • @SCOA57KrutikaAhire-en1ob
    @SCOA57KrutikaAhire-en1ob Місяць тому

    wooow glad i found my people in this comment section .. not everyone is this excited to watch such stuff

  • @dimitriosdesmos4699
    @dimitriosdesmos4699 Рік тому

    great stuff

  • @leandrogregorio8801
    @leandrogregorio8801 10 місяців тому

    Very interesting

  • @kalebpierson1262
    @kalebpierson1262 4 місяці тому

    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.

  • @acle_
    @acle_ Рік тому +1

    im wondering if the final structure ever self-intersects

  • @Temu_ko
    @Temu_ko Рік тому +1

    there exists chains of consecutive numbers without prime numbers of arbietrary lengh. So the "prime laberynth" can have columns in one direction arbitraery large

  • @Expert.Fisherman
    @Expert.Fisherman Рік тому +2

    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  Рік тому +1

      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 Рік тому +3

      sounds incredibly inefficient for large n values

  • @UZPRO11
    @UZPRO11 Рік тому +1

    best of best

  • @wagdan79
    @wagdan79 3 місяці тому

    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?

  • @xjuhox
    @xjuhox Рік тому +1

    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?

  • @irigima9974
    @irigima9974 3 місяці тому

    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.

  • @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  Рік тому +4

      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.

  • @Jevelthelazy
    @Jevelthelazy 7 місяців тому

    ill call the number line a Prime Spagetti

  • @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?

  • @mikefromspace
    @mikefromspace 4 місяці тому

    A name for your block maze? How 'bout the endless Minecraft dungeon? It would need a world higher than 256 though haha

  • @ahole5407
    @ahole5407 4 місяці тому

    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

  • @kimeg7294
    @kimeg7294 Рік тому +1

    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

  • @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?

  • @bujitself
    @bujitself Рік тому

    Prime pipes. Cuz that reminds me of a Windows screensaver

  • @tokajileo5928
    @tokajileo5928 3 місяці тому

    I programmed in pascal and c/c++ but this programming language seems way complicated for me.

  • @gokusupersaiyan6
    @gokusupersaiyan6 Рік тому

    I saw a small man holding a gun in your wallpaper :D @07:01

  • @PanWojtek
    @PanWojtek Рік тому

    we have great ways to visualize prime numbers, but we still can't derive the formula for n primes

  • @anypuppet
    @anypuppet 11 місяців тому

    Three letters: WOW🎉

  • @mzakyr42
    @mzakyr42 Рік тому

    The end i think its should be prime line or line of the prime

  • @electrictrojan6719
    @electrictrojan6719 Рік тому

    What's the music name?

  • @Terandium
    @Terandium Рік тому

    Why robot voice :c other than that cool video

  • @damianojeda938
    @damianojeda938 19 днів тому

    is 1 not considered prime?

  • @carlfranz6805
    @carlfranz6805 Рік тому

    Call your discovery 'Bob'. It's short, a palindrome, and dyslexic friendly. 🤣😎

  • @frankconley7630
    @frankconley7630 Рік тому

    Prime track.

  • @helpeytb
    @helpeytb 4 місяці тому

    6:41 no we actually do live on a simulation due to me seeing some weird syit happening with balls

    • @helpeytb
      @helpeytb 4 місяці тому

      The proof is due to the balls NOT THE SIMULATION

  • @tamadaanilkumar4738
    @tamadaanilkumar4738 Рік тому

    I bet u all took a few screenshots of these patterns

  • @jackchampagne.r
    @jackchampagne.r Рік тому

    Source code?

  • @SlinkyD
    @SlinkyD Рік тому

    Prime Sierpenski Lattice

  • @jankucera8505
    @jankucera8505 Рік тому

    make an infinite game based on it

  • @shivangyadav5887
    @shivangyadav5887 Рік тому +2

    I am scared

  • @VoidWasHere._.
    @VoidWasHere._. Рік тому +1

    First

  • @tamphex
    @tamphex Рік тому

    rEvEnGe 0f Th3 N3RdZ

  • @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 5 місяців тому +1

    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.

  • @dclxviclan
    @dclxviclan Рік тому

    Let's start learn Math 👽

  • @Slaygee
    @Slaygee Рік тому

    what

  • @yurisich
    @yurisich 9 місяців тому

    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