Posted by
codewithdharma
on
- Get link
- X
- Other Apps
An Armstrong number (also known as a narcissistic number, pluperfect digital invariant, or pluperfect number) is a number that is the sum of its own digits each raised to the power of the number of digits. In other words, an n-digit number is an Armstrong number if the sum of its digits, each raised to the power of n, is equal to the number itself.
For example, let's consider a 3-digit number like 153:
1^3 + 5^3 + 3^3 = 1 + 125 + 27 = 153
Since the sum is equal to the original number, 153 is an Armstrong number.
Here are a few more examples:
1634 is an Armstrong number because 1^4 + 6^4 + 3^4 + 4^4 = 1634.
9474 is an Armstrong number because 9^4 + 4^4 + 7^4 + 4^4 = 9474.
Armstrong numbers are named after Michael F. Armstrong, who first introduced them in a 1938 publication. These numbers are interesting mathematical curiosities and are often used as programming exercises.
Comments
Post a Comment