Program to check if N is a Centered Octadecagonal number | C # implementation to check that a number is a centered octadecagonal number or not ; Function to check that the number is a centered octadecagonal number ; Implement the formula generated ; Condition to check if the number is a Centered octadecagonal number ; Driver Code ; Function call
using System ; class GFG { static bool isCenteredOctadecagonal ( int N ) { double n = ( 9 + Math . Sqrt ( 36 * N + 45 ) ) / 18 ; return ( n - ( int ) n ) == 0 ; } static public void Main ( ) { int n = 19 ; if ( isCenteredOctadecagonal ( n ) ) { Console . Write ( " Yes " ) ; } else { Console . Write ( " No " ) ; } } }