Размер видео: 1280 X 720853 X 480640 X 360
Показать панель управления
Автовоспроизведение
Автоповтор
Excellent
Thanks
The sum from k=0 to n of x**k is equal to (x**(k + 1) - 1) / (x - 1). In this case x = 27, so you must calculate 27**6, which can be done with repeated squaring. 27**6 = 3**18 = (((3**2)**2)**2)**2 * 3**2 = ((9**2)**2)**2 * 9 = (81**2)**2 * 9 = 6561**2 * 9. 6561**2 can be calculated using Karatsuba algorithm as follows: 6561**2 = 65**2 * 100**2 + ((65 + 61)**2 - 65**2 - 61**2)*100 + 61**2.65**2 = (60 + 5)**2 = 60**2 + 2*5*60 + 5**2 = 3600 + 600 + 25 = 422561**2 = (60 + 1)**2 = 60**2 + 2*1*60 + 1**2 = 3600 + 120 + 1 = 3721 (65 + 61)**2 = 65**2 + 2*65*61 + 61**2 = 65**2 + 2*(61**2 + 61*4) + 61**2 = 4225 + 2*(3721 + 244) + 3721 = 15876So 6561**2 = 4225*100**2 + (15876 - 4225 - 3721)*100 + 3721 = 43046721.43046721 * 9 = 430467210 - 43046721 = 387420489.So the final answer is 387420488 / 26 = 14900788.I'm not sure which way is better. Maybe more Karatsuba?
❤️
Quicker to do the multiplications from scratch although more likely to make an error that way
👎
Excellent
Thanks
The sum from k=0 to n of x**k is equal to (x**(k + 1) - 1) / (x - 1). In this case x = 27, so you must calculate 27**6, which can be done with repeated squaring. 27**6 = 3**18 = (((3**2)**2)**2)**2 * 3**2 = ((9**2)**2)**2 * 9 = (81**2)**2 * 9 = 6561**2 * 9. 6561**2 can be calculated using Karatsuba algorithm as follows: 6561**2 = 65**2 * 100**2 + ((65 + 61)**2 - 65**2 - 61**2)*100 + 61**2.
65**2 = (60 + 5)**2 = 60**2 + 2*5*60 + 5**2 = 3600 + 600 + 25 = 4225
61**2 = (60 + 1)**2 = 60**2 + 2*1*60 + 1**2 = 3600 + 120 + 1 = 3721
(65 + 61)**2 = 65**2 + 2*65*61 + 61**2 = 65**2 + 2*(61**2 + 61*4) + 61**2 = 4225 + 2*(3721 + 244) + 3721 = 15876
So 6561**2 = 4225*100**2 + (15876 - 4225 - 3721)*100 + 3721 = 43046721.
43046721 * 9 = 430467210 - 43046721 = 387420489.
So the final answer is 387420488 / 26 = 14900788.
I'm not sure which way is better. Maybe more Karatsuba?
❤️
Quicker to do the multiplications from scratch although more likely to make an error that way
👎