ARMSTRONG NUMBER of N digits in JAVA | SOLVED WITH EXPLANATION IN JAVA | doubts post the comments.

Опубликовано: 08 Февраль 2026
на канале: Hacker Vlogs
560
5

ARMSTRONG NUMBER of N digits in JAVA

Try to solve: ARMSTRONG NUMBER series for N digits (1-10000)

A positive number is called Armstrong number
if it is equal to the sum of power of its digits with length of that number
Eg: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 153, 370, 371, 407, 1634, 8208, 9474 etc..,

Let's try to understand why 153 is an Armstrong number.
length is 3 so cubes each digits
153 = (1*1*1)+(5*5*5)+(3*3*3)
where:
(1*1*1)=1
(5*5*5)=125
(3*3*3)=27
So:
1+125+27=153

Let's try to understand why 1634 is an Armstrong number.
length is 4 so power the digits with four
where:
(1*1*1*1)=1
(6*6*6*6)=1296
(3*3*3*3)=81
(4*4*4*4)=256
So:
1+1296+81+256=1634