Coding Challenge 167: Ulam Spiral of Prime Numbers
The Coding Train The Coding Train
1.68M subscribers
748,053 views
0

 Published On Feb 20, 2022

šŸ’» 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: Ā Ā /Ā 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 Ā Ā /Ā 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: Ā Ā /Ā thecodingtrainĀ Ā 
šŸ“ø 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

show more

Share/Embed