Idoneal Numbers | Java implementation for the above approach ; Function to check if number is an Idoneal numbers ; Iterate for all triples pairs ( a , b , c ) ; If the condition is satisfied ; Driver Code ; Function Call
import java . lang . * ; class GFG { static boolean isIdoneal ( int n ) { for ( int a = 1 ; a <= n ; a ++ ) { for ( int b = a + 1 ; b <= n ; b ++ ) { for ( int c = b + 1 ; c <= n ; c ++ ) { if ( a * b + b * c + c * a == n ) return false ; } } } return true ; } public static void main ( String [ ] args ) { int N = 10 ; if ( isIdoneal ( N ) ) System . out . print ( " Yes " ) ; else System . out . print ( " No " ) ; } }