Count of N digit palindromic numbers divisible by 9 | Function to find the count of N digits palindromic numbers which are divisible by 9 ; if N is odd ; if N is even ; Driver Code
function countPalindromic ( n ) { var count ; if ( n % 2 == 1 ) { count = Math . pow ( 9 , ( n - 1 ) / 2 ) ; } else { count = Math . pow ( 9 , ( n - 2 ) / 2 ) ; } return count ; } var n = 3 ; document . write ( countPalindromic ( n ) ) ;