Logic for Armstrong number :) Armstrong Number An Armstrong number is a positive m-digit number that is equal to the sum of the m th powers of their digits. It is also known as pluperfect , or Plus Perfect , or Narcissistic number. It is an OEIS sequence A005188 . Let’s understand it through an example. Armstrong Number Example 1: 1 1 = 1 2: 2 1 = 2 3: 3 1 = 3 153: 1 3 + 5 3 + 3 3 = 1 + 125+ 27 = 153 125: 1 3 + 2 3 + 5 3 = 1 + 8 + 125 = 134 (Not an Armstrong Number) 1634: 1 4 + 6 4 + 3 4 + 4 4 = 1 + 1296 + 81 + 256 = 1643 //Armstrong number list:0,1,153,370,371,407,1634 //Eg 153 rest to 3(Total number of digit ) each digit if addition come original number. package javaPrograms; import java.util.Scanner; public class ArmstrongNumber { public static vo...
Blog which contains C#, asp.net, asp.net MVC, Selenium webdriver with core java, Bootstrap, Jquery and many more