Closed Dentyr closed 2 years ago
💖 Thanks for opening this issue. 💖
A Codinasion team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines.
Hey @Dentyr
Thanks for noticing this issue 👍🏻
This issue will be resolved soon
Hey @harshraj8843 can I work on this issue?
Hey @harshraj8843 can I work on this issue?
Sure 👍🏻
Steps to resolve this issue :-
programme/armstrong-number
Description
As stated in Wikipedia, including other sources: (https://en.wikipedia.org/wiki/Narcissistic_number) "In number theory, a narcissistic number (also known as a pluperfect digital invariant, an Armstrong number, or a plus perfect number) in a given number base b is a number that is the sum of its own digits each raised to the power of the number of digits."
Meanwhile, in the current documentation: "Armstrong number is a number that is equal to the sum of cubes of its digits."
So in the python script, it says,
while temp > 0: digit = temp % 10 sum += digit ** 3 temp //= 10
For Armstrong numbers which have 3 digits, this will be correct. However, for any other Armstrong numbers, like 1634, the program will incorrectly say that it is not an Armstrong number.
Screenshots
No response
Additional information
No response