Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
17
Task/Munchausen-numbers/Maple/munchausen-numbers.maple
Normal file
17
Task/Munchausen-numbers/Maple/munchausen-numbers.maple
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
isMunchausen := proc(n::posint)
|
||||
local num_digits;
|
||||
num_digits := map(x -> StringTools:-Ord(x) - 48, StringTools:-Explode(convert(n, string)));
|
||||
return evalb(n = convert(map(x -> x^x, num_digits), `+`));
|
||||
end proc;
|
||||
|
||||
Munchausen_upto := proc(n::posint) local k, count, list_num;
|
||||
list_num := [];
|
||||
for k to n do
|
||||
if isMunchausen(k) then
|
||||
list_num := [op(list_num), k];
|
||||
end if;
|
||||
end do;
|
||||
return list_num;
|
||||
end proc;
|
||||
|
||||
Munchausen_upto(5000);
|
||||
Loading…
Add table
Add a link
Reference in a new issue