Number of compositions of a natural number | PHP program to find the total number of compositions of a natural number ; Return 2 raised to power ( n - 1 ) ; Driver Code
< ? php function countCompositions ( $ n ) { return ( ( 1 ) << ( $ n - 1 ) ) ; } $ n = 4 ; echo countCompositions ( $ n ) , " STRNEWLINE " ; ? >