Menu Close

For-each-positive-integer-n-consider-the-highest-common-factor-h-n-of-the-two-numbers-n-1-and-n-1-For-n-lt-100-find-the-largest-value-of-h-n-




Question Number 21230 by Tinkutara last updated on 16/Sep/17
For each positive integer n, consider  the highest common factor h_n  of the two  numbers n! + 1 and (n + 1)!. For n < 100,  find the largest value of h_n .
$$\mathrm{For}\:\mathrm{each}\:\mathrm{positive}\:\mathrm{integer}\:{n},\:\mathrm{consider} \\ $$$$\mathrm{the}\:\mathrm{highest}\:\mathrm{common}\:\mathrm{factor}\:{h}_{{n}} \:\mathrm{of}\:\mathrm{the}\:\mathrm{two} \\ $$$$\mathrm{numbers}\:{n}!\:+\:\mathrm{1}\:\mathrm{and}\:\left({n}\:+\:\mathrm{1}\right)!.\:\mathrm{For}\:{n}\:<\:\mathrm{100}, \\ $$$$\mathrm{find}\:\mathrm{the}\:\mathrm{largest}\:\mathrm{value}\:\mathrm{of}\:{h}_{{n}} . \\ $$
Answered by dioph last updated on 17/Sep/17
as the numbers from 2 until n do not  divide n!+1, h_n  is either 1 or n+1.  h_n =n+1 ⇔ n!+1=k(n+1)  ⇔ n! ≡ −1 (mod n+1)  using Wilsons theorem, this happens  only when n+1 is prime.  The last prime before 100 is 97 so  for 96!+1 and 97! we have h_n =97
$$\mathrm{as}\:\mathrm{the}\:\mathrm{numbers}\:\mathrm{from}\:\mathrm{2}\:\mathrm{until}\:{n}\:\mathrm{do}\:\mathrm{not} \\ $$$$\mathrm{divide}\:{n}!+\mathrm{1},\:{h}_{{n}} \:\mathrm{is}\:\mathrm{either}\:\mathrm{1}\:\mathrm{or}\:{n}+\mathrm{1}. \\ $$$${h}_{{n}} ={n}+\mathrm{1}\:\Leftrightarrow\:{n}!+\mathrm{1}={k}\left({n}+\mathrm{1}\right) \\ $$$$\Leftrightarrow\:{n}!\:\equiv\:−\mathrm{1}\:\left(\mathrm{mod}\:{n}+\mathrm{1}\right) \\ $$$$\mathrm{using}\:\mathrm{Wilsons}\:\mathrm{theorem},\:\mathrm{this}\:\mathrm{happens} \\ $$$$\mathrm{only}\:\mathrm{when}\:{n}+\mathrm{1}\:\mathrm{is}\:\mathrm{prime}. \\ $$$$\mathrm{The}\:\mathrm{last}\:\mathrm{prime}\:\mathrm{before}\:\mathrm{100}\:\mathrm{is}\:\mathrm{97}\:\mathrm{so} \\ $$$$\mathrm{for}\:\mathrm{96}!+\mathrm{1}\:\mathrm{and}\:\mathrm{97}!\:\mathrm{we}\:\mathrm{have}\:{h}_{{n}} =\mathrm{97} \\ $$
Commented by Tinkutara last updated on 17/Sep/17
How do you used Wilson′s theorem?
$$\mathrm{How}\:\mathrm{do}\:\mathrm{you}\:\mathrm{used}\:\mathrm{Wilson}'\mathrm{s}\:\mathrm{theorem}? \\ $$

Leave a Reply

Your email address will not be published. Required fields are marked *