text: Pell Number | Pell Number Series using Recursion in C # ; calculate n - th Pell number ; Driver function
code: using System ; class PellNumber { public static int pell ( int n ) { if ( n <= 2 ) return n ; return 2 * pell ( n - 1 ) + pell ( n - 2 ) ; } public static void Main ( ) { int n = 4 ; Console . Write ( pell ( n ) ) ; } }