Count of a , b & c after n seconds for given reproduction rate | Function to print the count of a , b and c after n seconds ; Number of multiples of 60 below n ; Multiple of 60 nearest to n ; Change all a to b ; Change all b to c ; Change each c to two a ; Print the updated values of a , b and c ; Driver code
< ? php function findCount ( $ n ) { $ a = 1 ; $ b = 0 ; $ c = 0 ; $ x = $ n / 60 ; $ a = pow ( 32 , $ x ) ; $ x = 60 * $ x ; for ( $ i = $ x + 1 ; $ i <= $ n ; $ i ++ ) { if ( $ i % 2 == 0 ) { $ b += $ a ; $ a = 0 ; } if ( $ i % 5 == 0 ) { $ c += $ b ; $ b = 0 ; } if ( $ i % 12 == 0 ) { $ a += ( 2 * $ c ) ; $ c = 0 ; } } echo ( " a ▁ = ▁ " . $ a . " , b = " ▁ . ▁ $ b ▁ . ▁ " , c = " } $ n = 72 ; findCount ( $ n ) ; ? >