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

ความคิดเห็น • 107

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

  • @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 หลายเดือนก่อน

      1:30

    • @tyjacobs6822
      @tyjacobs6822 หลายเดือนก่อน

      1:30

  • @Jeremy_Moro
    @Jeremy_Moro ปีที่แล้ว +7

    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 ปีที่แล้ว +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!

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

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

  • @Chickenwing38nigeria
    @Chickenwing38nigeria ปีที่แล้ว +3

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

  • @experimenteeer
    @experimenteeer 7 หลายเดือนก่อน +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.

  • @tagberli
    @tagberli ปีที่แล้ว +3

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

  • @cesarrojas6744
    @cesarrojas6744 ปีที่แล้ว +1

    It's amazing how well done this video is.

  • @alvarocubi
    @alvarocubi ปีที่แล้ว +2

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

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

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

  • @taylor.matson
    @taylor.matson 15 วันที่ผ่านมา

    Cool video and nice bg music :)

  • @graxxarecords3456
    @graxxarecords3456 ปีที่แล้ว +2

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

  • @JaskaranSingh-im5hw
    @JaskaranSingh-im5hw ปีที่แล้ว +2

    Very interesting take on prime numbers visualizations!

  • @akin.kilic.
    @akin.kilic. ปีที่แล้ว +3

    For some reason, this makes me feel insignificant.

  • @duoc-moi
    @duoc-moi 27 วันที่ผ่านมา

    So beautiful!

  • @antonyshakesby4368
    @antonyshakesby4368 ปีที่แล้ว +1

    Amazing. Really enjoyed this one!

  • @aariskazi9002
    @aariskazi9002 10 หลายเดือนก่อน +1

    Love your work and presentation

  • @MrBrassmonkey12345
    @MrBrassmonkey12345 7 หลายเดือนก่อน

    Why is this so insanely good?

  • @FunWithBits
    @FunWithBits หลายเดือนก่อน

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

  • @jac556
    @jac556 9 หลายเดือนก่อน

    This is amazing. Thank you for sharing!

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

  • @DaRza17
    @DaRza17 8 หลายเดือนก่อน

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

  • @code-dredd
    @code-dredd ปีที่แล้ว +3

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

  • @ArashRabbani
    @ArashRabbani ปีที่แล้ว +1

    Amazing videos indeed. You deserve milloins of subs :)

  • @Matematica_Aplicada
    @Matematica_Aplicada ปีที่แล้ว +1

    Amazing video!!!

  • @thefootles
    @thefootles ปีที่แล้ว +1

    This channel is going to get very big!

  • @palasaripasar836
    @palasaripasar836 ปีที่แล้ว

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

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

  • @philtoa334
    @philtoa334 ปีที่แล้ว

    Beautiful.

  • @fredg8328
    @fredg8328 10 วันที่ผ่านมา

    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.

  • @MarioAbbruscato
    @MarioAbbruscato ปีที่แล้ว +1

    infinite amazement

  • @SkyFly19853
    @SkyFly19853 ปีที่แล้ว

    Truly nice.

  • @SCOA57KrutikaAhire-en1ob
    @SCOA57KrutikaAhire-en1ob 2 หลายเดือนก่อน

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

  • @leandrogregorio8801
    @leandrogregorio8801 11 หลายเดือนก่อน

    Very interesting

  • @dimitriosdesmos4699
    @dimitriosdesmos4699 ปีที่แล้ว

    great stuff

  • @mayankbhaisora2699
    @mayankbhaisora2699 ปีที่แล้ว

    Man this is so cool

  • @UZPRO11
    @UZPRO11 ปีที่แล้ว +1

    best of best

  • @simonstrandgaard5503
    @simonstrandgaard5503 3 หลายเดือนก่อน

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

  • @MrKasenom
    @MrKasenom ปีที่แล้ว

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

  • @sumongus
    @sumongus ปีที่แล้ว +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

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

  • @jerryiuliano871
    @jerryiuliano871 8 หลายเดือนก่อน

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

  • @tudastar4646
    @tudastar4646 8 หลายเดือนก่อน

    Please more 3D number patterns !

  • @kalebpierson1262
    @kalebpierson1262 5 หลายเดือนก่อน

    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.

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

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

  • @mikefromspace
    @mikefromspace 5 หลายเดือนก่อน

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

  • @wagdan79
    @wagdan79 4 หลายเดือนก่อน

    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?

  • @anypuppet
    @anypuppet ปีที่แล้ว

    Three letters: WOW🎉

  • @acle_
    @acle_ ปีที่แล้ว +1

    im wondering if the final structure ever self-intersects

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

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

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

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

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

  • @ahole5407
    @ahole5407 5 หลายเดือนก่อน

    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

  • @Jevelthelazy
    @Jevelthelazy 8 หลายเดือนก่อน

    ill call the number line a Prime Spagetti

  • @tokajileo5928
    @tokajileo5928 4 หลายเดือนก่อน

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

  • @irigima9974
    @irigima9974 4 หลายเดือนก่อน

    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.

  • @frankconley7630
    @frankconley7630 ปีที่แล้ว

    Prime track.

  • @PanWojtek
    @PanWojtek ปีที่แล้ว

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

  • @damianojeda938
    @damianojeda938 หลายเดือนก่อน

    is 1 not considered prime?

  • @electrictrojan6719
    @electrictrojan6719 ปีที่แล้ว

    What's the music name?

  • @carlfranz6805
    @carlfranz6805 ปีที่แล้ว

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

  • @shivangyadav5887
    @shivangyadav5887 ปีที่แล้ว +2

    I am scared

  • @Terandium
    @Terandium ปีที่แล้ว

    Why robot voice :c other than that cool video

  • @SlinkyD
    @SlinkyD ปีที่แล้ว

    Prime Sierpenski Lattice

  • @mzakyr42
    @mzakyr42 ปีที่แล้ว

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

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

  • @tamadaanilkumar4738
    @tamadaanilkumar4738 ปีที่แล้ว

    I bet u all took a few screenshots of these patterns

  • @helpeytb
    @helpeytb 5 หลายเดือนก่อน

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

    • @helpeytb
      @helpeytb 5 หลายเดือนก่อน

      The proof is due to the balls NOT THE SIMULATION

  • @soulblade9142
    @soulblade9142 ปีที่แล้ว

    pipes

  • @jankucera8505
    @jankucera8505 ปีที่แล้ว

    make an infinite game based on it

  • @fuzzyelectrons
    @fuzzyelectrons 6 หลายเดือนก่อน +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.

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

  • @dclxviclan
    @dclxviclan ปีที่แล้ว

    Let's start learn Math 👽

  • @VoidWasHere._.
    @VoidWasHere._. ปีที่แล้ว +1

    First

  • @Slaygee
    @Slaygee ปีที่แล้ว

    what

  • @yurisich
    @yurisich 10 หลายเดือนก่อน

    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