**INTRODUCTION**

A Dudeney number is a **positive integer** for which the sum of its digits is equal to the the **cube root** of the number itself. The name derives from **Henry Dudeney**, who noted the existence of these numbers in one of his puzzles, *Root Extraction*, where a professor in retirement at **Colney Hatch** postulated this as a general method for root extraction.

For example:

512 = (5+1+2)^{3 } = 8^{3}

19683= (1+9+6+8+3)^{3} = 27^{3}

0 and 1 are **T****rivial Dudeney numbers** and all other Dudeney numbers are **N****ontrivial Dudeney numbers**.

For in-depth Mathematical information regarding the nature of the Dudeney Number, please- Click Here.

**JAVA CODE**

public class Dudeney

{

public static void main(int n)

{

int x=n; //Creating a copy of the number

int sum=0; //Variable to calculate sum of digits

while(n!=0)

{

int a=n%10; //Extracting the Digit

sum=sum+a; //Calculating the sum of Digits

n=n/10; //Reducing the number of Digit by 1 (removing the units Digit)

}

if(x==(sum*sum*sum)) //Condition of Dudeney Number

System.out.println (“Yes; A Dudeney Number”);

else

System.out.println (“Not a Dudeney Number”);

}

}

**LIST OF DUDENEY NUMBERS
**

0

1

512

4913

5832

17576

19683

**FUN FACT**

There are **only 6** Dudeney numbers. You might not find the validity of this statement. If interested to know the proof of the statement by using techniques like *Bounding From Above*, *Limiting The Search Space*, and *Brute Force The Remaining Possibilities*, please- Click Here.

## Leave a Reply