private bool IsLychrelNumber(int number) { string numberPresentation = number.ToString(); for (int i = 0; i < 50; ++i) { numberPresentation = NumberAsString.Sum(new string[] { numberPresentation, new string(numberPresentation.Reverse().ToArray()) }); if (IsPolindrom(numberPresentation)) { return(false); } } return(true); }
public string Run(int numbersCount) { string result = NumberAsString.Sum(numbers); return(result.Substring(0, numbersCount)); }