Module:Sandbox/Fulla07

local p = {} --p stands for package

function p.isHappy( n ) --get single digits local lastDigit local tmp = 0 lastDigit = n % 10 tmp = tmp + lastDigit^2 return tmp --sum up the squares

end

return p