public override object Run(RunModes runMode, object input, bool Logging) { int minIndex = (int)input + 1; while (true) { long tri = Triangle.Generate(minIndex); if (Pentagonal.IsPentagonal(tri) && Hexagonal.IsHexagonal(tri)) { return(tri); } minIndex++; } }