Find the last two digits of this expression:
7x19x31x43x55x........x2023
p=1; clc;
for i=7:12:2023
p=mod(p*i,10000);
end
disp([i p])
finds the last four digits are 4375, so the last two are 75. Notably, ever since the calculation passed multiplying by 115, the last two digits of the partial answer have alternated between 75 and 25.
or the full extended precision:
clc; p=sym(1);
for i=7:12:2023
p=p*i;
end
disp(p)
79257505790058107794415325520264004672257962902293720683267347518990514520424666
91168844608968811773328578629555716514411884455378694518627498622195604274842437
72556134324034266593763394433411841276680964437207773764167661158534047633130239
31026112479765051573356067300873941571963655354278675701639027230291439039645439
75039804199948337879182185917216084208364640380615321609473757236008441328192160
39564880987905257148584762334216134348572911358097909964772043167613446712493896
484375
also shows 75.
|
Posted by Charlie
on 2024-01-07 09:07:39 |