Sequence

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

Properties

Description

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

Sum

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

Methods

Cascade

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

GenerateAllSequences

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

ToArray

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