Find sum of the digits of: 2023
2023
For example, the sum of digits of 216= 65536 is 6+5+5+3+6 =25
>> sod(sym(2023)^2023)
ans =
30112
where sod is
function sd = sod(n0)
sd=0;
n1=char(string(n0));
for i=1:length(n1)
sd=sd+str2double(n1(i));
end
end
as we're getting closer to the new year:
>> sod(sym(2023)^2024)
ans =
30118
and
>> sod(sym(2024)^2024)
ans =
29917
|
Posted by Charlie
on 2023-10-27 12:52:57 |