Newman | C # program to find nth element of Newman - Conway Sequence ; Recursion to find n - th element ; Driver code
using System ; class GFG { static int sequence ( int n ) { if ( n == 1 n == 2 ) return 1 ; else return sequence ( sequence ( n - 1 ) ) + sequence ( n - sequence ( n - 1 ) ) ; } public static void Main ( ) { int n = 10 ; Console . Write ( sequence ( n ) ) ; } }