/// <summary>
 /// Generate a list of  numbers
 /// </summary>
 /// <param name="max">The maximum number of  numbers</param>
 public TriangleNumberGenerator(long max = 3)
 {
     this.Limit   = max;
     this.Numbers = new List <long>();
     for (int i = 1; i <= this.Limit; i++)
     {
         this.Numbers.Add(TriangleNumberGenerator.Get(i));
     }
 }
예제 #2
0
 /// <summary>
 /// Return the triangle number
 /// </summary>
 /// <param name="number">The number to test</param>
 /// <returns>True if is a triangle number</returns>
 public static Boolean IsTriangleNumber(int number)
 {
     return(TriangleNumberGenerator.IsTriangleNumber(number));
 }