6

The task is to calculate: $128! \pmod{257}$ I know that I'm supposed to use Wilson's theorem but I don't know how to apply it here.

[Reopen note: we already have answers (e.g. here) showing how to use Wilson's theorem to deduce $\,128!^2\equiv -1\equiv 16^2\pmod{\!257}\,$ so what remains is proving whether $\,128!\equiv 16\,$ or $\,128!\equiv -16\pmod{\!257}\ $ -- Bill D.]

Bill Dubuque
  • 282,220
m123
  • 61
  • 2
    $(-1)^{128}(128!)^2=128!(257-128)(257-127)...(256)=256!=-1\pmod{257}$ gives you the remainder of the square of $128!$. – MoonLightSyzygy Jan 01 '20 at 22:29
  • @MoonLightSyzygy - ah I think I see the first step now. 1(mod 257) = -256(mod257). 2(mod 257) = -255(mod 257). and keep going all the way to 128 which is in the middle. – Adam Rubinson Jan 01 '20 at 22:40
  • 1
    @MoonLightSyzygy: so that means $128!\equiv\pm16\pmod{257}$, but is $128!\equiv +16$ or $-16$? – J. W. Tanner Jan 01 '20 at 22:46
  • @J.W.Tanner There is a button near the top that says 'Ask Question'. You can use it. – MoonLightSyzygy Jan 01 '20 at 23:06
  • 2
    @MoonLightSyzygy a bit of a patronising tone. Also it's worth checking to see if his question has been answered elsewhere on the site, which might take some time searching. – Adam Rubinson Jan 01 '20 at 23:08
  • @AdamRubinson I can afford it. – MoonLightSyzygy Jan 01 '20 at 23:10
  • @Bill could you have another look, please. There is discussion about the dupe closure. – quid Jan 01 '20 at 23:18
  • @J.W.T See this MO thread for how to determine the sign generally. Iirc part of that is here too but I can't find it at the moment. – Bill Dubuque Jan 01 '20 at 23:37
  • 1
    @m123 Could you please double check if the problem asks about $128!$ or $128!^2.\ $ The latter is much more common (and easier). Did you devise the problem? If not, what is its source? – Bill Dubuque Jan 01 '20 at 23:45
  • Thanks, @BillDubuque – J. W. Tanner Jan 01 '20 at 23:53
  • 1
    @BillDubuque I'm sure that the problem asks about 128! This was on our exam at faculty couple of weeks ago, so I guess that our teaching assistant came up with this example – m123 Jan 02 '20 at 10:40
  • 1
    @m123 Ok, I reopened it. – Bill Dubuque Jan 02 '20 at 18:41
  • 1
    There doesn't seem to be a particularly nice way to find the sign, as shown here: https://mathoverflow.net/questions/293728/the-square-root-of-wilsons-theorem-when-p-equiv-1-mod-4?noredirect=1&lq=1

    It's not hard, however, to run a quick program and show that the answer is 16 and not -16.

    – Alvin Chen Jan 02 '20 at 19:32
  • 1
    @J.W.T Oops I see I inadvertantly linked to the $,p=3\pmod{4}$ vs. $,p=1\pmod{4},$ MO thread (in the prior comment). But they are all linked together anyhow. Just in case you missed it. – Bill Dubuque Jan 03 '20 at 03:57
  • @m123 Does your context presume knowledge of class groups of quadratic fields or related advanced notions, or is it just elementary number theory? – Bill Dubuque Jan 03 '20 at 03:59
  • @BillDubuque Just elementary number theory – m123 Jan 03 '20 at 10:59

0 Answers0