initial solution -  not working due to JS precision issues
added helper method to calculate largest power that doess not require scientific notation