Newmanâ €“ Shanksâ €“ Williams prime | C # Program to find Newman - Shanks - Williams prime ; return nth Newman - Shanks - Williams prime ; Base case ; Recursive step ; Driver code
using System ; class GFG { static int nswp ( int n ) { if ( n == 0 n == 1 ) return 1 ; return 2 * nswp ( n - 1 ) + nswp ( n - 2 ) ; } public static void Main ( ) { int n = 3 ; Console . WriteLine ( nswp ( n ) ) ; } }