text: Curzon Numbers | C # implementation of the approach ; Function to check if a number is a curzon number or not ; Find 2 ^ N + 1 ; Find 2 * N + 1 ; Check for divisibility ; Driver code
code: using System ; class GFG { static void checkIfCurzonNumber ( long N ) { double powerTerm , productTerm ; powerTerm = Math . Pow ( 2 , N ) + 1 ; productTerm = 2 * N + 1 ; if ( powerTerm % productTerm == 0 ) Console . WriteLine ( " Yes " ) ; else Console . WriteLine ( " No " ) ; } static public void Main ( ) { long N = 5 ; checkIfCurzonNumber ( N ) ; N = 10 ; checkIfCurzonNumber ( N ) ; } }