public long GetNext(long next) { while (true) { var nextTriangleNumber = TriangleNumber.GetNumber(next); if (Pentagonnumber.GetN(nextTriangleNumber) > 0 && HexagonalNumber.GetN(nextTriangleNumber) > 0) { return(nextTriangleNumber); } next++; } }
public void TestTriangleGetN(long n, int tn) { Assert.Equal(tn, Pentagonnumber.GetN(n)); }