Utility method to return sum of square of digit of n
< ? php function numSquareSum ( $ n ) { $ squareSum = 0 ; while ( $ n ) { $ squareSum += ( $ n % 10 ) * ( $ n % 10 ) ; $ n /= 10 ; } return $ squareSum ; }