Amazing video, I really love the exploratory style! I had always wondered how this could lead to a fast method for prime checking as I thought computing the nth row was still very expensive, it was nice to learn how it could be done. I'm going to start looking up maths papers for things I am curious about after watching this.
Important thing to be noted is this property is known from 1600 .. AKS prime testing indeed use it as initial lemma but but but it have advance modular and polynomial property involve which make it faster
There is a faster way to calculate the n-th row. n choose (k+1) is just n choose k multiplied by (n - k) / (k+1) Easy to verify. I wrote the procedure in PL/SQL instead of python, but you should be able to convert. Problem is that the code needs to be a bit more advanced for larger numbers, but this is also easy doable. create or replace function prime_check (p_integer in integer) return boolean is l_test integer := p_integer; l_mod integer; begin for k in 2 .. floor (p_integer / 2) loop l_test := l_test * (p_integer - k + 1) / k; l_mod := mod (l_test, p_integer); exit when l_mod != 0; end loop; return l_mod = 0; end prime_check; /
"Dereliquerunt me lantern aquae vivae." "The number 1, joined to infinity, adds nothing to it, no more than one foot to an infinite measure. The finite is annihilated in the presence of the infinite, and becomes a pure nothing. So our spirit before God, so our justice before divine justice. There is not so great a disproportion between our justice and that of God, as between 1 and infinity…." ~Blaise Pascal.
Link to the original Pascal's triangle video ruclips.net/video/HvIh1Ngah0A/видео.html
Amazing video, I really love the exploratory style! I had always wondered how this could lead to a fast method for prime checking as I thought computing the nth row was still very expensive, it was nice to learn how it could be done. I'm going to start looking up maths papers for things I am curious about after watching this.
Thanks! Ya prime numbers and stuff is quite far from what I normally do, but when the paper has a nice "idea" section you can totally get into it :)
Really interesting video. A lot went over my head but I grasped just enough to appreciate how amazing this algorithm is!
Important thing to be noted is this property is known from 1600 .. AKS prime testing indeed use it as initial lemma but but but it have advance modular and polynomial property involve which make it faster
There is a faster way to calculate the n-th row. n choose (k+1) is just n choose k multiplied by (n - k) / (k+1)
Easy to verify. I wrote the procedure in PL/SQL instead of python, but you should be able to convert.
Problem is that the code needs to be a bit more advanced for larger numbers, but this is also easy doable.
create or replace function prime_check (p_integer in integer) return boolean
is
l_test integer := p_integer;
l_mod integer;
begin
for k in 2 .. floor (p_integer / 2)
loop
l_test := l_test * (p_integer - k + 1) / k;
l_mod := mod (l_test, p_integer);
exit when l_mod != 0;
end loop;
return l_mod = 0;
end prime_check;
/
Great follow up & video!
Thank you!!!
"Dereliquerunt me lantern aquae vivae."
"The number 1, joined to infinity, adds nothing to it, no more than one foot to an infinite measure. The finite is annihilated in the presence of the infinite, and becomes a pure nothing. So our spirit before God, so our justice before divine justice. There is not so great a disproportion between our justice and that of God, as between 1 and infinity…." ~Blaise Pascal.