PokeVideoPlayer v0.9-rev1 - licensed under gpl3-or-later
Oh no, the video couldn't be loaded :(
You can try refreshing the page!
...
Views : 7,399,649
Genre: Education
Date of upload: Mar 28, 2024 ^^
Rating : 4.874 (7,604/233,419 LTDR)
96.85% of the users lieked the video!!
3.15% of the users dislieked the video!!
User score: 95.27- Overwhelmingly Positive
RYD date created : 2024-07-27T03:45:48.541404Z
See in json
Top Comments of this video!! :3
In my teenage years, I developed a technique to test if any given number can be divided by a prime. You can think of 2, 7, 23, 137, ...
The number 37 is quite interesting, as the recursion involves only three unique steps using my method. While it usually takes six unique steps for common prime numbers.
I won't necessarily lay down the whole method here, but the resulting recursive function for 37 is as follow:
1. Multiply the rightmost digit by 26
2. Add the digit as is on its left
3. Continuing another step on the left; add the 3rd number, multiplied by 10
Continue the sum from step 1 with the 4th digit, towards the left, and so on.
Let's test the number 6401 (notice all the sums can be divided by 37):
1*26 + 0 + 4*10 + 6*26 = 222
2*26 + 2 + 2*10 = 74
4*26 + 7 = 111
1*26 + 1 + 1*10 = 37
For a total of 4 recursions. Not necessarily the most practical computation, but it turns out correct. You might get stuck in a loop between two multiples of 37 depending on the tested number. Without more thought into the mathematics that hold the function, the particular outcome is currently not determined.
You can probably notice different patterns in the steps and their sums. I like to think we can optimize it further from there.
19 |
@veritasium
3 months ago
If you enjoyed hearing our expert Tom Magliery discuss his 37 collection, you can watch an extended interview with him - for free! - over on our Patreon ve42.co/PatreonTom
612 |