Man used &#x27;formula&#x27; to win more than $400k on Lotto