Tip:
Highlight text to annotate it
X
What's going on everybody? Welcome
to this video on elementary number theory.
My name is Jack Jenkins and this
is Academy of One. Today
I'm going to be talking about the euclidean algorithm. In this
video, I'm gonna be talking about
the euclidean algorithm.
Then we're gonna be taking a look at some JavaScript code.
For the euclidean algorithm. Remember, if you don't
know JavaScript go ahead and watch my series on JavaScript.
[Music]
[Music]
Here's how it works, you divide a and
b. And then you divide the results with the
modulo. And you keep going until
zero. Let's do an example. We have a =
77 and b = 63.
So first we have 77
divided by 63.
We'll that returns 1 with a remainder of
14. Now let's take that. We have
63/
14 now. And that will equal 4 with the remainder of
7. Now we move it again. We have
14/7 and we get a perfect number with
no remainder. So that must mean the greatest common
divisor of these two number is
7. Which is true.
[Music]
[Music]
Now I'm gonna be showing you the JavaScript code for
this algorithm. Let's say we have a function called
euclid algorithm which takes in two parameters
x and y. Now, while
y is not equal to zero, we
have an integer r equals x
modulo y. And then we swap them, we have
x = y and y = r.
And we keep doing that until we return
x. And that's it for our
last actual video in the series of elementary
number theory. Tune in next time for when we
are going to be talking about the series
conclusion. Time for the plugs. Go ahead and
visit academyofone.org
where we're gonna be having more information on the series that will be
coming. Which includes computational
and analytical number theory.
Two subjects that will just blow your mind.
As we'll as you can find all the math courses
that you would love to take. Now, don't forget
to also donate. Cause donating will help us
improve the video quality and help us get like better
mics and help the podcast and such.
Speaking of podcast, you can have questions emailed to me at
jack@academyofone.org. And
If you're asking questions to the podcast, email me at
podcast@academyofone.org.
And lastly, go ahead and
subscribe the channel on youtube, that way you can know
when the new video pops up. Have a great day.
[Music]
[Music]
[Music]
[Music]