How to resolve the algorithm Munchausen numbers step by step in the zkl programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm Munchausen numbers step by step in the zkl programming language
Table of Contents
Problem Statement
A Munchausen number is a natural number n the sum of whose digits (in base 10), each raised to the power of itself, equals n. (Munchausen is also spelled: Münchhausen.) For instance: 3435 = 33 + 44 + 33 + 55
Find all Munchausen numbers between 1 and 5000.
Let's start with the solution:
Step by Step solution about How to resolve the algorithm Munchausen numbers step by step in the zkl programming language
Source code in the zkl programming language
[1..5000].filter(fcn(n){ n==n.split().reduce(fcn(s,n){ s + n.pow(n) },0) })
.println();
You may also check:How to resolve the algorithm User input/Graphical step by step in the C++ programming language
You may also check:How to resolve the algorithm Hello world/Graphical step by step in the Axe programming language
You may also check:How to resolve the algorithm Haversine formula step by step in the ZX Spectrum Basic programming language
You may also check:How to resolve the algorithm Empty program step by step in the BQN programming language
You may also check:How to resolve the algorithm Program name step by step in the Emacs Lisp programming language