Sequence

References
[DebuggerDisplay("{Description} = {Sum}")] public class Sequence
Represents a summation sequence consisting of positive integers.

Properties

Description

#
public string Description { get; }
Gets the summation series for this sequence.

Sum

#
public int Sum { get; }
Gets the sum of this sequence.

Methods

Cascade

#
public Sequence Cascade()
Cascase the leftmost element in the sequence that is larger than it's right neighbour. TODO: what? the above makes no sense...
Cascaded sequence.

GenerateAllSequences

#
public static Sequence[] GenerateAllSequences(int count, int target)
Generate all possible sequences that add up to a target value.
count (int)Number of elements in the sequence.
target (int)Target sum.
An array of sequence elements that sum up to target.

ToArray

#
public int[] ToArray()
Convert this sequence into an array.
Integer array.