Check if a number can be written as sum of three consecutive integers | function to check if a number can be written as sum of three consecutive integers . ; if n is multiple of 3 ; else print " - 1" . ; Driver Program
< ? php function checksum ( $ n ) { if ( $ n % 3 == 0 ) echo $ n / 3 - 1 , " ▁ " , $ n / 3 , " ▁ " , $ n / 3 + 1 ; else echo " - 1" ; } $ n = 6 ; checksum ( $ n ) ; ? >