Question Number 191758 by Mingma last updated on 30/Apr/23
Answered by AST last updated on 30/Apr/23
$$\mathrm{521}^{\mathrm{1000}} \equiv\mathrm{0001}\left({mod}\:\mathrm{10000}\right)\: \\ $$$$\left(\mathrm{521},\mathrm{10000}\right)=\mathrm{1}\:\Rightarrow\:\:\mathrm{521}^{\mathrm{999}} \equiv\frac{\mathrm{1}}{\mathrm{521}}\left({mod}\:\mathrm{10000}\right) \\ $$$$\frac{\mathrm{1}}{\mathrm{521}}\equiv{x}\left({mod}\mathrm{10000}\right)\Rightarrow\mathrm{521}{x}\equiv\mathrm{1}\left({mod}\:\mathrm{10000}\right) \\ $$$$\mathrm{10000}{q}−\mathrm{521}{x}=−\mathrm{1} \\ $$$$\Rightarrow{x}\:{is}\:{odd} \\ $$$$\mathrm{521}{x}=\mathrm{521}\left(\mathrm{2}{k}+\mathrm{1}\right)=\left(\mathrm{500}+\mathrm{21}\right)\left(\mathrm{2}{k}+\mathrm{1}\right) \\ $$$$=\mathrm{500}\left(\mathrm{2}{k}+\mathrm{1}\right)+\mathrm{21}{x}=\mathrm{1000}{k}+\mathrm{500}+\mathrm{21}{x} \\ $$$$\Rightarrow\mathrm{521}{x}\equiv\mathrm{500}+\mathrm{21}{x}\equiv\mathrm{1}\left({mod}\:\mathrm{10000}\right) \\ $$$$\Rightarrow\mathrm{21}{x}\equiv−\mathrm{499}\equiv\mathrm{9501}\left({mod}\:\mathrm{10000}\right) \\ $$$$\mathrm{21}{x}\equiv\mathrm{9501}\left({mod}\:\mathrm{10000}\right)\Rightarrow\mathrm{21}{x}\equiv\mathrm{39501}\left({mod}\:\mathrm{10000}\right) \\ $$$$\Rightarrow{x}\equiv\mathrm{1881}\left({mod}\:\mathrm{10000}\right) \\ $$$$\Rightarrow{Last}\:{four}\:{digits}\:{of}\:\mathrm{521}^{\mathrm{999}} =\mathrm{1881} \\ $$
Commented by malwan last updated on 30/Apr/23
$$\mathrm{1881} \\ $$
Commented by Mingma last updated on 30/Apr/23
How did you jump from 10000q-521x-=1 to 21x modulo 9501?
Can you explain that, please!
Commented by AST last updated on 30/Apr/23
$${Done}. \\ $$
Commented by Mingma last updated on 30/Apr/23
Perfect
Answered by mr W last updated on 30/Apr/23
$${known}:\:\mathrm{521}^{\mathrm{1000}} =\mathrm{10}^{\mathrm{4}} {n}+\mathrm{1} \\ $$$${say}:\:\mathrm{521}^{\mathrm{999}} =\mathrm{10}^{\mathrm{4}} {m}+{x}\:{with}\:\mathrm{1}\leqslant{x}<\mathrm{10}^{\mathrm{4}} \\ $$$$\left(\mathrm{10}^{\mathrm{4}} {m}+{x}\right)×\mathrm{521}=\mathrm{10}^{\mathrm{4}} {n}+\mathrm{1} \\ $$$$\Rightarrow\mathrm{521}{x}−\mathrm{1}=\left({n}−\mathrm{521}{m}\right)×\mathrm{10}^{\mathrm{4}} ={k}×\mathrm{10}^{\mathrm{4}} \\ $$$${we}\:{see}\:{that}\:{last}\:{digit}\:{of}\:{x}\:{must}\:{be}\:\mathrm{1}. \\ $$$${say}\:{x}=\mathrm{10}{y}+\mathrm{1},\:{then} \\ $$$$\mathrm{521}\left(\mathrm{10}{y}+\mathrm{1}\right)−\mathrm{1}={k}×\mathrm{10}^{\mathrm{4}} \\ $$$$\Rightarrow\mathrm{521}{y}+\mathrm{52}={k}×\mathrm{10}^{\mathrm{3}} \\ $$$${we}\:{see}\:{the}\:{last}\:{digit}\:{of}\:{y}\:{must}\:{be}\:\mathrm{8}, \\ $$$${i}.{e}.\:{the}\:{last}\:\mathrm{2}\:{digits}\:{of}\:{x}\:{must}\:{be}\:\mathrm{81}. \\ $$$${say}\:{x}=\mathrm{100}{z}+\mathrm{81},\:{then} \\ $$$$\mathrm{521}\left(\mathrm{100}{z}+\mathrm{81}\right)−\mathrm{1}={k}×\mathrm{10}^{\mathrm{4}} \\ $$$$\Rightarrow\mathrm{521}{z}+\mathrm{422}={k}×\mathrm{10}^{\mathrm{2}} \\ $$$${we}\:{see}\:{the}\:{last}\:{digit}\:{of}\:{z}\:{must}\:{be}\:\mathrm{8}, \\ $$$${i}.{e}.\:{the}\:{last}\:\mathrm{3}\:{digits}\:{of}\:{x}\:{must}\:{be}\:\mathrm{881}. \\ $$$${say}\:{x}=\mathrm{1000}{w}+\mathrm{881},\:{then} \\ $$$$\mathrm{521}\left(\mathrm{1000}{w}+\mathrm{881}\right)−\mathrm{1}={k}×\mathrm{10}^{\mathrm{4}} \\ $$$$\Rightarrow\mathrm{521}{w}+\mathrm{459}={k}×\mathrm{10} \\ $$$${we}\:{see}\:{the}\:{last}\:{digit}\:{of}\:{w}\:{must}\:{be}\:\mathrm{1}, \\ $$$${i}.{e}.\:{the}\:{last}\:\mathrm{4}\:{digits}\:{of}\:{x}\:{must}\:{be}\:\mathrm{1881}. \\ $$$$\Rightarrow{x}=\mathrm{1881} \\ $$$${i}.{e}.\:{the}\:{last}\:{four}\:{digits}\:{of}\:\mathrm{521}^{\mathrm{999}} \:{are} \\ $$$$\mathrm{1881}. \\ $$
Commented by Mingma last updated on 30/Apr/23
Nice work!