Munchausen numbers

From Fōrmulæ wiki
Revision as of 17:30, 23 March 2019 by Admin (Talk | contribs) (Description (from Rosetta Code))

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This page is the answer to the task Munchausen numbers in the Rosetta Code.

Description (from Rosetta Code)

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

Task

Find all Munchausen numbers between 1 and 5000

Also see:

Program

MunchausenNumbersProgram.png

Results

MunchausenNumbersOutput.png

In bases other than 10

The program requires a small change:

MunchausenNumbersBaseProgram.png

Showing the Munchausen numbers between 1 and 100,000 from bases 2 to 100:

MunchausenNumbersBaseOutput.png