Find a range of composite numbers of given length | method to find factorial of given number ; to print range of length n having all composite integers ; Driver Code
< ? php function factorial ( $ n ) { if ( $ n == 0 ) return 1 ; return $ n * factorial ( $ n - 1 ) ; } function printRange ( $ n ) { $ a = factorial ( $ n + 2 ) + 2 ; $ b = $ a + $ n - 1 ; echo " [ " , $ a , " , ▁ " , $ b , " ] " ; return 0 ; } $ n = 3 ; printRange ( $ n ) ; ? >