Achilles Number in JavaIn this section, we will learn what is an Achilles number and also create Java programs to check if the given number is an Achilles number or not. The Achilles number program frequently asked in Java coding tests and academics. Achilles NumberA number that is a powerful number but not a perfect power is known as Achilles number. It is an integer sequence A052486 in OEIS.
Let's understand it mathematically through an example. Achilles Number ExampleLet's check the number 108 is an Achilles number or not. The factors of 108 = 2 x 2 x 3 x 3 x 3. Prime factors are 2 and 3. Square of prime factors are: Let's take another number 784 and check it is an Achilles number or not. The factors of 784 = 2 x 2 x 2 x 2 x 7 x 7. Prime factors are 2 and 7. Square of prime factors are: Similarly, we can check other numbers. First few Achilles numbers are 72, 108, 200, 288, 392, 432, 500, 648, 675, 800, 864, 968, 972, 1125, 1152, 1323, 1352, 1372, 1568, 1800, 1944, 2000, 2312, 2592, 2700, 2888, 3087, 3200, 3267, 3456, 3528, 3872, 3888, 4000, 4232, 4500, 4563, 4608, 5000, etc. Steps to Find Achilles Number
Let's implement the above steps in a Java program. Achilles Number Java ProgramAchillesNumberExample.java Output 1: Output 2: Next TopicAmicable Pair Number in Java |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India