Coding Challenge #110: Recamán's Sequence - Part 1

preview_player
Показать описание


Other Parts of this Challenge:

References:

Videos:

Related Coding Challenges:

Timestamps:
0:00 Introduction!
1:56 Discussing the Recamán's Sequence
6:08 Starting to code and adding the prerequisites to generate the sequence
7:18 Writing the algorithm to generate the numbers of the sequence
8:36 Testing the algorithm
9:40 Adding the counter
10:44 Visualizing the algorithm!
13:48 Making continuous series of arcs instead of ellipses
16:20 An exercise to pause and try for yourself!
16:50 Creating an Arc class and an array of arcs
19:33 Scaling down the animation as we move along the Recamán's Sequence
21:34 Scaling down by the biggest number in the sequence generated so far
22:34 Explore the Recamán's Sequence and share your works!

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

#numbersequence #recamanssequence #music #audiovisual #visualization #p5js #javascript
Рекомендации по теме
Комментарии
Автор

I coded that same visualisation when the numberphile video came out 😂 I thought "that's a coding challenge dan could make", and you did 😂 Bravo!

loic.bertrand
Автор

You're very inspiring. You make coding fun and pretty,
and math is actually quite understandable in your videos :D
so thanks, Dan :')

robertaradi
Автор

You watch numberphile, nice! 😀
As always awesome code.

I challenge you to make a 3d wireframe of a Klein bottle.

Invalid
Автор

Ive been watching your videos for a while now, and i just want to say that they are the best thing ever. Before i found your channel i had already an interest for math and programming and i tried to learn to code on my own, but it was all too confusing. But then your tutorials just made it all make sense. Im 16 and thanks to you i have decided that i want to study computer science when i get to college. I dont usually leave comments and i know this is kind of long, but thank you so much, your videos rock, and keep up the good work!

RicardoGarcia-mmfo
Автор

I remember this stream. It took you 3-4 attempts to do the intro.

grimtin
Автор

Dan, this is some of the best live coding I've seen you do. Especially creating the arc class. Congratulations.

DaveBriccetti
Автор

Coloring in the Arc when it hits a prime could be fun, maybe i'll try that out when i have some time later ! :)

loreer
Автор

Awesome vid as always Dan, I always love it when you’re able to incorporate numberphile topics into your code. Btw congrats on 500k Subscribers!

gamingbutnotreally
Автор

Omg I wanted this! And aaghh I too watched the numberphile video and wanted to code it. THIS IS EXACTLY WHAT I WANTED!
Beautiful sequence and pattern!

aidanzoldyk
Автор

This is so weird, I was thinking of recommending this as a challenge to you just the other day after seeing the Numberphile video about it!

marcpatersn
Автор

15:24 The elegant solution you asked for is to get the int of count%2==0; and count%2!=0; and multiply them to 0 and PI in the arc method.

huh_wtf
Автор

I did something similar to this after watching the numberphile video a few weeks back. I ended up rotating the screen and plotting circles where x is determined by the number in the sequence and the radius based on the number in the sequence/2. It created a very pleasant visualization. I also experimented using the the values to plot points on a growing vertex shape.

thomasruck
Автор

This channel is a mix of harmony and chaos haha

coolbrotherf
Автор

Saw the numberphile video. Thought: hey, shiffman's gotta check this out !. and then this happened :P

nvadot
Автор

Not sure how to send code to you without spamming your inbox, so I'll describe how I added colour to the arcs:
My first attempt was to put stroke(start % 256, end % 256, count % 256); in place of the white you added in the Arc class, but every time the colour changed, the palette of the entire screen changed. So I added a colour variable to the constructor, and passed in the array [index % 256, next % 256, count % 256] when calling the Arc function, and now each arc has its own colour. It's rather pretty, too, I think.

FlameStrykeShadowDark
Автор

Something I'd love to see is an animation of a dot tracing the path of these arcs for the first few hundred numbers, just so there's a sense of direction to it.
I'm also curious to see if a similar sequence can be defined in the complex plane, but probably not considering the sequence excludes necessarily excludes negatives so some similar problem would probably be the case for complex numbers.

VoidHugger
Автор

Could you mabye do a video on how the online library of babel works

AB-Prince
Автор

The numberphile is cool, and this is quite interesting.

hanniffydinn
Автор

I did code the sequence too after I watched the video,

trobolina
Автор

Can someone please explain me the step() function? Doesn't it just return you to the previous spot if you already landed on a spot or it's negative? It doesn't add the count twice so it cancels out the previous subtraction.

lm-dev