Magic Numbers Medium

+100 PTS

Before you start the test, check out our tutorial challenge

  • TYPE CODE PRACTICE CHALLENGE
  • LANGUAGES BASH, C, C++, C# AND 20 MORE
    LANGUAGES BASH, C, C++, C#, CLOJURE, ELIXIR, ERLANG, GO, GROOVY, HASKELL, JAVA, JAVASCRIPT, JULIA, KOTLIN, NIM, PERL, PHP, PYTHON2, PYTHON, RUBY, RUST, SWIFT, TYPESCRIPT, VB
  • TIME ~60MIN

Magic Numbers

Challenge outline

Hello and welcome to the challenge!


A magic number is a number which fulfills this dependence: d1^1 + d2^2 + ... + dn^n = D, where D is the number and d1..dn are its digits (respectively). The example of such a number is 135, because 1^1 + 3^2 + 5^3 = 135. Write a code which detects all magic numbers in the given range x..y.


Have fun and good luck! :)