The Prime Spiral (Coding Challenge 167)

The Prime Spiral (Coding Challenge 167)

Why do prime numbers show up as diagonals in a spiral? In this video, I create a visualization in JavaScript (p5.js) of the Ulam Spiral (aka Prime Spiral) named for Polish Mathematician Stanislav Ulan. https://thecodingtrain.com/CodingChallenges/167-prime-spiral.html

p5.js Web Editor Sketches:
๐Ÿ•น️ Prime (Ulam) Spiral: https://editor.p5js.org/codingtrain/sketches/0Ud-XsaYb
๐Ÿ•น️ Number Spiral: https://editor.p5js.org/codingtrain/sketches/Zs65bV-Al
๐Ÿ•น️ Prime vs Random Spiral: https://editor.p5js.org/codingtrain/sketches/3np1hBlXD
๐Ÿ•น️ Shapes and Color: https://editor.p5js.org/codingtrain/sketches/mCvvSKpZ5
๐Ÿ•น️ Incorporating 3D: https://editor.p5js.org/codingtrain/sketches/-eX078HZ5

๐ŸŽฅ Previous video: https://youtu.be/55iwMYv8tGI?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
๐ŸŽฅ All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH

Links discussed in this video:
๐Ÿ”— CodingTrainChooChoo on Twitch: https://www.twitch.tv/codingtrainchoochoo
๐Ÿ”— Coding Train Twitch Archive: https://www.youtube.com/channel/UCcNasmuTD4kb_HC1Z5lcuxg
๐Ÿ”— Mathematical Games: The remarkable lore of the prime numbers (1964): https://www.scientificamerican.com/article/mathematical-games-1964-03/
๐Ÿ”— An Observation on the Distribution of Primes, M. Stein and S. M. Ulam: https://doi.org/10.2307/2314055
๐Ÿ”— Prime Numbers (Wikipedia): https://en.wikipedia.org/wiki/Prime_number
๐Ÿ”— List of Prime Numbers: https://en.wikipedia.org/wiki/List_of_prime_numbers
๐Ÿ”— Download Processing 4: https://processing.org/download

Other videos mentioned in this video:
๐ŸŽฅ Prime Spirals: https://youtu.be/iFuR97YcSLM

๐ŸŽถ Processing Theme Selector music by https://twitter.com/WillFromAmerica

Timestamps:
0:00 Welcome! Choo choo!
0:23 History of Ulam Spiral
1:16 Diagramming the Spiral
2:18 Starting to Code
3:25 How and when do I rotate?
4:25 Coding the number spiral
7:00 Debugging!
9:40 Visualizing the spiral
12:22 What is a prime number?
14:31 Code to check if a number is prime.
18:57 Marking primes in the spiral
19:40 Porting to Processing (Java)!
22:46 More references and examples

๐Ÿš‚ Website: http://thecodingtrain.com/
๐Ÿ‘พ Share Your Creation! https://thecodingtrain.com/Guides/community-contribution-guide.html
๐Ÿšฉ Suggest Topics: https://github.com/CodingTrain/Rainbow-Topics
๐Ÿ’ก GitHub: https://github.com/CodingTrain
๐Ÿ’ฌ Discord: https://discord.gg/hPuGy2g
๐Ÿ’– Membership: http://youtube.com/thecodingtrain/join
๐Ÿ›’ Store: https://standard.tv/codingtrain
๐Ÿ“š Books: https://www.amazon.com/shop/thecodingtrain
๐Ÿ–‹️ Twitter: https://twitter.com/thecodingtrain
๐Ÿ“ธ Instagram: https://www.instagram.com/the.coding.train/

๐ŸŽฅ Coding Challenges: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
๐ŸŽฅ Intro to Programming: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA

๐Ÿ”— p5.js: https://p5js.org
๐Ÿ”— p5.js Web Editor: https://editor.p5js.org/
๐Ÿ”— Processing: https://processing.org

๐Ÿ“„ Code of Conduct: https://github.com/CodingTrain/Code-of-Conduct

This description was auto-generated. If you see a problem, please open an issue: https://github.com/CodingTrain/website/issues/new

PrimeSpiral(Coding

Post a Comment

0 Comments