Retired

Narcissistic number with constant base (retired)

Description
Loading description...
Fundamentals
  • Please sign in or sign up to leave a comment.
  • jgmarquesm Avatar

    Hey man... Did you check the tests one-by-one?

    According to the example in the instructions, we have to take an input number, and the base of the expansion is the length of that number... Right? And then calculate for each digit of the input number: base^digit.

    But in some tests it fails... For example, when we take the number 12, the base is 2, so we get: 2^1 + 2^2 = 2 + 4 = 6, but the test isnarcissistic(12) returns True instead of False.

    • B1ts Avatar

      For example, when we take the number 12, the base is 2,

      Why is the base 2? Try it with base 3. You may need to check many bases to know the final result.

      It seems you didn't really understand the task, and tests seem to be fine. That's not a kata issue.

      Issue marked resolved by B1ts 3 years ago
  • FArekkusu Avatar

    Narcissistic number with constant base are numbers where the sum of a base with the exponent of a number gives the result

    This sentence is incorrect, and the task is different from what is said here. Also, this has nothing to do with narcissistic numbers.

    • Yanni2 Avatar

      Why should it have nothing to do with narcissistic numbers? Narcissistic numbers also include numbers where the exponent is changed.

    • Yanni2 Avatar

      Which title would you then suggest for the katar?

    • FArekkusu Avatar

      Narcissistic numbers also include numbers where the exponent is changed

      What? A narcissistic number by definition is a number where the following equation is true: sum(digit**len(number) for digit in number) == number. You're asking for a completely different thing.