A number with n digits such that it is equal to the sum of the nth powers of its digits is called an n-Armstrong number.
For example 1634 is a 4-Armstrong number because
14 + 64 + 34 + 44 = 1 + 1296 + 81 + 256 = 1634.
There are 88 such numbers in base 10.
Chat with our AI personalities
0 137
702-934-4268
yes
The Armstrong numbers from 0 to 10000 are 1,153, 370, 371, 407!! That's it Nothing more and nothing less ;) Let k be the number of digits in a number, n, and d1,d2,d3,d4... be the digits of n. Say n=370. Then k=3 and d1=3, d2=7 and d3=0. Now 33+73+03=370. So 370 is an Armstrong number. Armstrong iff n=d1k+d2k+d3k+d4k+...
<html> <head> <Script Language="JavaScript"> var a,n,b=0,t; n=parseInt(window.prompt("enter n","0")); t=n; while(n>0) { a=n%10; b=b+a*a*a; n=n/10; } if(b==t) { document.writeln("Armstrong no"); } else { document.writeln("Not an Armstrong no"); } </script> </head> </html>