Enter dictionary symbols. ex: 123AB

Dictionary size: {{ formCtrl.k.split("").length }}




Parameters

$K = $ {{ formCtrl.k }}
$N = $ {{ formCtrl.n }}
Combination Length: {{ formCtrl.combinationLength(formCtrl.k, formCtrl.n) }}
De Bruijn Length: {{ formCtrl.sequenceLength(formCtrl.k, formCtrl.n, 0) }}

Difficulty

 {{ formCtrl.sequenceLength(formCtrl.k, formCtrl.n, 375) }} inputs

Often used in combinatorial mathematics, a de Bruijn sequence is the shortest circular sequence of length $\sigma^n$ such that every string of length $n$ on the alphabet $a$ of size $\sigma$ occurs as a contiguous subrange of the sequence described by $a$.
Such a sequence is denoted by $B(k,n)$ and has length $k^n$, which is also the number of distinct substrings of length $n$ on $a$.

For example, a de Bruijn sequence of order $n=2$ on the alphabet $a={a,b,c}$ will result in the following solution {a,a,c,b,b,c,c,a,b}.

Therefore, de Bruijn sequences are optimally short. Here's the formula to count the distinct number of de Bruijn sequences for $B(k,n)$.

$$B(k,n) = \frac{(k!)^{k^{n-1}}}{k^n}$$

The sequences are named after the Dutch mathematician Nicolaas Govert de Bruijn. According to him, the existence of de Bruijn sequences for each order together with the above properties were first proved with alphabets composed of two elements by Camille Flye Sainte-Marie in 1894. Later, the generalization of this concept to larger alphabets is the result of the mathematical studies conducted by Tanja van Aardenne-Ehrenfest and himself.