Consider N = 20222022
Reading from left to right, determine:
(1) The last 4 digits of N.
(2) The first 4 digits of N.
Probable intended solution:
(1)
p=1;
for i=1:2022
p=mod(p*2022,10000);
end
disp(p)
yields the last four digits as 1584.
TI-84 plus CE calculator:
1 STO>P
For(I,1,2022)
(P*2022) STO>P
remainder(P,10000)STO>P
End
leaves 1584 in P.
(2)
Find the common log of the answer:
>> 2022*log(2022)/log(10)
ans =
6684.28948783757
Then find the antilog of the mantissa:
>> 10^0.28948783757
ans =
1.94754650808029
First four digits are 1947. In fact the accuacy should be reliable up to four fewer (for the four we lose to the characteristic) than show: 1.9475465080, although rounding would bring the last digit to 1; I'd say it does actually truncate to 0.
However MATLAB can give us all 6685 digits:
sym(2022)^2022
gives an answer that begins
ans =
19475465080987987461884359219297025987247775482742134438609736103478324990332...
and ends
...2576971189936148072764791763047709211277938901049215288399825028158870438563056451584,
with thousands of intervening digits. As the logarithm above shows, there are 6685 digits altogether.
|
Posted by Charlie
on 2022-03-02 13:54:28 |