Number algorithms

  • 20
Suppose the number S consists of M digits. For example, if S = 370, then M (the number of digits) = 3 Implement the getNumbers method. Among natural numbers less than N (long), it should find all the numbers satisfying the following criterion: The number S is equal to the sum of its digits raised in the Mth
You can't complete this task, because you're not signed in.
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Oleksii ChernyshLevel 27 , Dnipro
6 December 2019, 21:22
Interesting task and no pain from validator compared to some previous tasks. Good to know that numbers start from 1, not 0. Possibly this is obvious but I didn't realize this from the requirements. And understood that these are Armstrong numbers only after solving the problem.