Coding Challenge 167: Ulam Spiral of Prime Numbers

The Coding Train
The Coding Train
751.5 هزار بار بازدید - 3 سال پیش - 💻 Code:
💻 Code: https://thecodingtrain.com/challenges...
✨ Watch the uncut version on Nebula! https://nebula.tv/videos/codingtrain-...
✨ Watch this video ad-free on Nebula! https://nebula.tv/videos/codingtrain-...

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.

p5.js Web Editor Sketches:
🕹️ Prime (Ulam) Spiral: https://editor.p5js.org/codingtrain/s...
🕹️ Number Spiral: https://editor.p5js.org/codingtrain/s...
🕹️ Prime vs Random Spiral: https://editor.p5js.org/codingtrain/s...
🕹️ Shapes & Color: https://editor.p5js.org/codingtrain/s...
🕹️ Incorporating 3D: https://editor.p5js.org/codingtrain/s...

🎥 Previous video: Coding Challenge 166: ASCII Text Images
🎥 Next video: Coding Challenge 168: MandelBulb 3D F...
🎥 All videos: Coding Challenges

References:
📺 CodingTrainChooChoo on Twitch: Twitch: codingtrainchoochoo
2️⃣ Mathematical Games: The remarkable lore of the prime numbers (1964): https://www.scientificamerican.com/ar...
📓 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_n...
🗄 List of Prime Numbers: https://en.wikipedia.org/wiki/List_of...
🔗 Download Processing 4: https://processing.org/download

Videos:
🎥 Prime Spirals: Prime Spirals - Numberphile

🎶 Processing Theme Selector music by Twitter: WillFromAmerica

Timestamps:
0:00 Welcome! Choo choo!
0:23 History of the 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 & examples

Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound

🚂 Website: http://thecodingtrain.com/
👾 Share Your Creation! https://thecodingtrain.com/guides/pas...
🚩 Suggest Topics: https://github.com/CodingTrain/Sugges...
💡 GitHub: https://github.com/CodingTrain
💬 Discord: https://thecodingtrain.com/discord
💖 Membership: http://youtube.com/thecodingtrain/join
🛒 Store: https://standard.tv/codingtrain
🖋️ Twitter: Twitter: thecodingtrain
📸 Instagram: Instagram: the.coding.train

🎥 Coding Challenges: Coding Challenges
🎥 Intro to Programming: Start learning here!

🔗 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-o...

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

#primenumbers #p5js #javascript
3 سال پیش در تاریخ 1400/12/01 منتشر شده است.
751,533 بـار بازدید شده
... بیشتر