Brush up on Number Theory tricks!

Поделиться
HTML-код
  • Опубликовано: 19 ноя 2024

Комментарии • 102

  • @mauithedog10
    @mauithedog10 3 года назад +37

    Ah yes, a classic from the 965 Lithuania Regional

    • @Kalmakka
      @Kalmakka 3 года назад +6

      The tasksetters were considering requiring Fermat's little theorem was a bit too difficult for a regional contest 700 years before Fermat, but I'm glad they went with this problem.

  • @goodplacetostop2973
    @goodplacetostop2973 3 года назад +51

    19:59 Good Place To-

  • @antonryzhov
    @antonryzhov 3 года назад +48

    2018 is -3 (mod 2021), therefore 3^965 + 2018^965 = 0 (mod 2021), everything cancels except 1^965 + 2^965

    • @aleksmich8928
      @aleksmich8928 3 года назад +14

      This is actually the way students did it in the contest!

    • @shivansh668
      @shivansh668 3 года назад +1

      @@aleksmich8928I think you are right 👍

    • @aleksmich8928
      @aleksmich8928 3 года назад +19

      Since, I'm the author of this problem and I graded it, I know exactly, that's how they did it. :D

    • @goodplacetostop2973
      @goodplacetostop2973 3 года назад +3

      @@aleksmich8928 Oh, really? That’s awesome!

    • @aleksmich8928
      @aleksmich8928 3 года назад +1

      @@琥珀-u3o Prof. J Matulionio konkursas.

  • @wjx8439
    @wjx8439 3 года назад +46

    You can also use the fact that:
    a^k+(n-a)^k==0 (mod n) [when k is odd]
    this can be proved by the binomial theorem.
    hence 1^965+...+2018^965
    ==1+2^965 (mod 2021)
    then separate 2021 into 43×47 and continue using Fermat's Little Theorem and Chinese Remainder Theorem to find the answer (as shown in the video).

    • @disguisedhell
      @disguisedhell 3 года назад +3

      Same that's what I did

    • @tretyakov3112
      @tretyakov3112 3 года назад +2

      Using FLT we get 2^1932==1. It means that 2^966==+-1==2021+-1 and 2^965==1010 or 1011.
      But how we can understand what answer is right?

    • @disguisedhell
      @disguisedhell 3 года назад +4

      @@tretyakov3112 firstly it is due to Euler totient function (not FLT). The answer to your question is carmaicheal's lamda function. Here is the link for more information. brilliant.org/wiki/carmichaels-lambda-function/. for 2021 it is computed to be 966 so 2^966=1(mod2021) hence 1011 is correct

    • @bahkimi
      @bahkimi 3 года назад +1

      That's exactly what I wanted to suggest from last night that I saw this clip. I am happy that you brought it up. It makes the problem much simpler in a flash. Good observation. Cheers

    • @andreben6224
      @andreben6224 2 года назад +1

      OH WOW that first trick is brilliant, but you can prove it without the binomial theorem:
      (n-a)^k == (-a)^k == -a^k (mod n)
      the negative sign can be taken out of the power since k is odd.
      Cheers ^_^

  • @siulibasak3804
    @siulibasak3804 3 года назад +3

    This is how i solved it:-
    First add 2019⁹⁶⁵ and 2020⁹⁶⁵ in the series and subtract it....
    Now 1⁹⁶⁵+......+2020⁹⁶⁵=0(mod 2021)
    And -2019⁹⁶⁵-2020⁹⁶⁵=2⁹⁶⁵+1(mod 2021)
    2⁹⁶⁵=22(mod 43)=24(mod 47)
    By applying CRT ,
    We get 2⁹⁶⁵=(-6×43+27×47)=1011(mod 2021)
    Hence 2⁹⁶⁵+1=1012(mod 2021).

  • @aadfg0
    @aadfg0 3 года назад +6

    Once you reduce to 1+2^(965), it's faster to use the Carmichael function. λ(2021) = lcm(phi(43),phi(47)) = lcm(42,46) = 966, hence 1+2^(965) = 1+2^(-1) = 1+1011 = 1012 mod 2021.

  • @karangupta1825
    @karangupta1825 3 года назад +9

    Sir, please make some videos on continued fractions, infinite series and telescopic series.

  • @CoderboyPB
    @CoderboyPB 3 года назад +24

    I make the start, calculatung 1 ^ 965 = 1.
    Who continues, calculating 2 ^965?

    • @goodplacetostop2973
      @goodplacetostop2973 3 года назад +12

      2^965 = 311850048364799970571308236412006025948039259443040240859773006630814358104525635278899682108224328295209757319405077381870693435686499009490495593482004909425000886398607136955865268975681716747289586991334988123957939133612635998263883635695006899610487641699336881506618514879741251551232
      Who's up for 3^965 ? 😂

    • @Tiessie
      @Tiessie 3 года назад

      3^965 =
      26424744965696434674099773974032308092224573978040981257705289527267515760247906169164940953548135938843058101748405157163998359546478733932427934900204067659560449046569731146203500924987307254381570731322381698195357292126803075083822714110800246875776396709235176980353102012918790335125467548185110827828641207186699042986158369594578865223081557017824157853629901637871411153715235235503494661961510311461221222065488082922187004767870921451332157114681843

    • @goodplacetostop2973
      @goodplacetostop2973 3 года назад

      @@nzf-kx2qol1g12 Everything is easier with Python, right? I was surprised it computed big numbers like pow(2018,965) so fast

    • @shivansh668
      @shivansh668 3 года назад

      @@Tiessie OK , How much time did you take to write it 😅

    • @TJStellmach
      @TJStellmach 3 года назад +1

      @@goodplacetostop2973 Well, a half decent algorithm will compute powers using only as many multiplications as twice the base 2 logarithm of the exponent.

  • @kamaljain5228
    @kamaljain5228 3 года назад +1

    3^965+2018^365 etc cancels out. So you are left with 1+2^965. If you double it you get 2+2^966, since 966 divides both 42 and 46, so 2^966 leaves remainder 1 when divided by 2021. So the double of your number leaves remainder 3, i.e., 2024 mod 2021. so your number leaves remainder 1012.

  • @jakobovergaard6302
    @jakobovergaard6302 3 года назад

    Since 2018 is congruent -3 (mod 2021) and there are an even number of numbers from 3 to 2018; pair up 2018 which is congruent with -3 wit 3 which is congruent 3. Pair up 2017 which is congruent -4 with 4 and so on. The exponents are odd, so all terms with a base larger than 2 will add to 0. Then simplify 2^965 with some easy tricks

  • @Tehom1
    @Tehom1 3 года назад +6

    "Maybe even a math contest from 965" :)

  • @crazy4hitman755
    @crazy4hitman755 3 года назад

    A couple of months ago I couldn’t solve any of your number theory problems but now I solve every one and it is thanks to you

  • @thephysicistcuber175
    @thephysicistcuber175 3 года назад +6

    It's definitely a problem from 965.

  • @d4slaimless
    @d4slaimless 3 года назад +2

    3:07 Took me 5 min to understand that that "Fermaztltzeoreem" is Fermat's little theorem.

  • @_judge_me_not
    @_judge_me_not 3 года назад

    1975 USAMO problem :-
    Prove that :
    [5x]+[5y] >= [3x+y]+[3y+x]
    where x,y>=0 and [u] denotes the greatest integer

    • @liyi-hua2111
      @liyi-hua2111 3 года назад

      horrible method here:
      first establish “[a+b] >= [a] + [b]” and “[a] + [-a] = -1 for a is in Z^c, if in Z then it’s 0”
      so [5x] + [5y] = [(3x+y) + (2x-y)] + [(3y+x) + (2y-x)]
      >= [3x+y] + [x+(x-y)] + [3y+x] + [y+(y-x)]
      >= [3x+y]+[3y+x] + [x] + [y] +([y-x] + [x-y])
      >= [3x+y]+[3y+x] + [x] + [y] -1
      from the inequality above we know that if x or y >= 1 then the given statement is true.
      (note : if (x-y) is in Z then the statement is true for any x,y)
      now we only need to prove 0 =< x, y

  • @nemo.refert
    @nemo.refert 3 года назад

    imo this was the most satisfying "good place to stop" so far

    • @mcwulf25
      @mcwulf25 3 года назад

      I stopped before then. I think pretty well every mod/remainder technique is in there somewhere

  • @deidara_8598
    @deidara_8598 3 года назад

    The reason the number 965 is special is because if you take the Carmichael function of 2021 you end up with 966, meaning that exponentiating by 965 is equivalent to taking the inverse over the finite field GF(2021), the problem could therefore also be expressed as 1 + 1/2 + 1/3 ... 1/2018 (mod 2021)

  • @writerightmathnation9481
    @writerightmathnation9481 7 месяцев назад

    Ah, the math contest from 965…. Bathed in nostalgia am I…

  • @easymathematik
    @easymathematik 5 месяцев назад

    I can remember this problem in 965.
    This was in my final exam.
    Time is passing so fast…. 😂

  • @davidgerber9317
    @davidgerber9317 3 года назад +1

    1:30 "I do not claim that this is the fastest method....."

  • @lucashoffses9019
    @lucashoffses9019 3 года назад +1

    Tiny nitpick that doesn’t effect the final result: The last block should actually start at 1979, because 46*43+1=1979

  • @shivansh668
    @shivansh668 3 года назад +4

    Even in 965 A. D. there were math contests 😅in Lithuania

  • @romajimamulo
    @romajimamulo 3 года назад +1

    Shouldn't M1 be -12 and M2 be 11? Then you wouldn't have to do a final modulo

  • @prithujsarkar2010
    @prithujsarkar2010 3 года назад +2

    Amazing video but i think you should check upon the color correction since the video looks a bit dull

    • @MichaelPennMath
      @MichaelPennMath  3 года назад +4

      I noticed that! The other day I went too far the other way and people thought I had dyed my hair! If anyone out there wants to make me a nice LUT for my videos I will happily send over a clip of un-corrected footage.

    • @typha
      @typha 3 года назад

      @@MichaelPennMath I can do that, sure :)
      And do you know what you typically use for your camera's white balance and exposure settings?

    • @MichaelPennMath
      @MichaelPennMath  3 года назад

      @Seth Harwood Thank you so much!! I'll send you all of the settings in the email.

  • @DrPhipster
    @DrPhipster 3 года назад

    +1 Like for doing exactly 20 minutes.

  • @nuto1981
    @nuto1981 3 года назад

    From the German Math Olympiad 2020:
    Prove that the following equation:
    x(x+1)(x+2)...(x+2020)-1=0
    only has one positive solution and prove that this solution satisfies the following inequality:
    1/(2020! + 10) < x < 1/(2020! + 6)

  • @genosingh
    @genosingh 3 года назад

    This is similar to a problem in a 2019 olympiad, can't remember correctly which one it was, anyways the problem was, 1^2019 + 2^2019....2020^2019 is divided by 2019, find the remainder, so in both questions we can use the proof that, (a+b)^n/k is an integer if a+b/k is an integer, so in the same way that we solve the problem I mentioned, we can solve the problem mentioned in the video, but we need to be careful, as basically the way we would group terms would be by doing : 3+2018, 4+2017.... and so on, however, if you observe carefully, the middle term would be left out(aka 2018/2 = 1009), so 1009/2021 would give the remainder 1009, and remember how we started from 3? Well 1 and 2 is left out so that will also count to the remainder, and the final remainder is : 1009+1+2 = 1012.
    Hope this helps :)

  • @momeme2925
    @momeme2925 3 года назад

    made a video about it using another approach :)

  • @MrKA1961
    @MrKA1961 3 года назад +3

    python dumb here again:
    print(sum([i**965 for i in range(1,2019)]) % 2021)

    • @pim4138
      @pim4138 3 года назад +5

      The pow-function has a remainder optional parameter. Replacing i**965 with pow(i, 965, 2021) will probably make the code run faster.

    • @MrKA1961
      @MrKA1961 3 года назад +1

      @@pim4138 Thanks for your comment, I didn't know about this. This makes cryptography things easier. It's really a useful piece of info.

  • @Bodyknock
    @Bodyknock 3 года назад

    6:35 I think the last 40 terms are supposed to be 1979^965 + ... + 2018^965 . (In the video it has 1977, not 1979)

    • @MrGreyprof
      @MrGreyprof 3 года назад

      Yes. But not important for the argument as they are reduced mods starting from 1, which is = to 1979

    • @Bodyknock
      @Bodyknock 3 года назад +2

      @@MrGreyprof Sure, I didn't say it affected the solution.

  • @suramanujan
    @suramanujan 3 года назад

    Large but simple! 😁

  • @jesusalej1
    @jesusalej1 3 года назад

    What if I tell you that remainder is 9?

  • @gervasiociampin2062
    @gervasiociampin2062 3 года назад

    2:07 what is the symbol for and called??

    • @klucha789
      @klucha789 3 года назад

      I think it's just a quick way of writing & (or ampersand)

    • @mikeschieffer2644
      @mikeschieffer2644 3 года назад

      Ampersand

  • @happyrogue7146
    @happyrogue7146 3 года назад

    viewer suggestion

  • @thekingadomas1656
    @thekingadomas1656 3 года назад +2

    Lithuanian brothers unite!!

  • @hassanalihusseini1717
    @hassanalihusseini1717 3 года назад

    Hating these modular arithmetics :-) but loving your videos explaining it so well!

  • @md2perpe
    @md2perpe 3 года назад

    Python one-liner: sum([n**965 for n in range(1, 2019)]) % 2021

    • @shivansh668
      @shivansh668 3 года назад

      Looks like you are a Programmer

    • @md2perpe
      @md2perpe 3 года назад

      @@shivansh668 Yes, I work as programmer. But I've always also been interested in mathematics and physics and have studied those topics too.

    • @shivansh668
      @shivansh668 3 года назад

      @@md2perpe Ohh , that's great

    • @shivansh668
      @shivansh668 3 года назад

      @@md2perpe Well, I also want to learn Python . I know some little basics but not too much and I'm really interested in it
      So, can you guide me,how to lern it?

    • @goodplacetostop2973
      @goodplacetostop2973 3 года назад

      Python is 👍

  • @skwbusaidi
    @skwbusaidi 3 года назад +2

    Thanks to bprp I like below method more than the Chinese remainders theorem
    N=23(mod 43) ----(1)
    N= 25 (mod 47)------(2)
    From 1
    N=43k+23 ---(3)
    Sub in 2
    43k+23 = 25 (mod 47)
    43k=2 (mod 47)
    -4k = 2 (mod 47)
    -2k = 1 (mod 47)
    -2k = -46 (mod 47)
    k= 23 (mod 47)
    k = 47m+23
    Sub in 3
    N = 43(47m+23) + 23
    N= 2021m + 1012
    N = 1012 (mod 2021)
    The answer is 1012

    • @MrGreyprof
      @MrGreyprof 3 года назад

      Which bprp video are you referring to??

    • @skwbusaidi
      @skwbusaidi 3 года назад

      @@MrGreyprof long time. You have to search

    • @MrGreyprof
      @MrGreyprof 3 года назад

      @@skwbusaidi Ok. Thanks

    • @skwbusaidi
      @skwbusaidi 3 года назад

      @@MrGreyprof
      Here is the link
      ruclips.net/video/LInNgWMtFEs/видео.html

  • @mcwulf25
    @mcwulf25 3 года назад

    Too much for me! 🤪

  • @vinc17fr
    @vinc17fr 3 года назад +1

    I haven't looked at the video. 20 minutes for that? In short: 2021 = 43 × 47. Let p = 43 or 47. Values divisible by p can be ignored, and for a non divisible by p, one has a^(p−1) ≡ 1 (mod p). Since 965 ≡ −1 (mod p−1), one has a^965 ≡ 1/a (mod p). In (Z/pZ)*, 1/a is a bijection, so that the sum of the inverses of all the elements is equal to the sum of the elements, which is 0. Since 2019 = −2 and 2020 = −1 are missing in the sum up to the next multiple of p (2021), 1^965 + … + 2018^965 = −(1/(−2) + 1/(−1)) = 1/2 + 1 in Z/pZ, for p = 43 and p = 47, which remains valid in Z/2021Z since 2 is invertible. This gives (2021 + 1)/2 + 1 = 1012.

    • @riadsouissi
      @riadsouissi 3 года назад

      Though there is a faster solution (canceling terms), I like your approach of using 1/a as a bijection in z/nz*

  • @tarnaskarnas9233
    @tarnaskarnas9233 3 года назад

    Metais

  • @jayska5802
    @jayska5802 3 года назад

    Hello

  • @דףאחדעלמתמטיקה
    @דףאחדעלמתמטיקה 3 года назад

    אם אתם דוברי עברית, אתם כנראה תהנו מהערוץ שלי 'דף אחד על מתמטיקה'. בואו לבדוק :)

  • @hauntedmasc
    @hauntedmasc 3 года назад

    Hmm.. I need to review my modular arithmetic. I'm not following how he's using mod46 reduction and mod47 reduction at the same time.

    • @agfd5659
      @agfd5659 3 года назад

      Look up fermat's little theorem

  • @valerior.d.6075
    @valerior.d.6075 3 года назад

    "The math problems are hard, tricky, challenging, but you, you will be worse..... Solve and prove until it's a good place to stop"

  • @DANIELIUX11
    @DANIELIUX11 3 года назад

    Lithuanian brothers unite!

  • @tarnaskarnas9233
    @tarnaskarnas9233 3 года назад

    Siaip matematika darr neegzistavo 965