Related papers: A loopless and branchless $O(1)$ algorithm to gene…
Let $0<k\in\mathbb{Z}$. The anchored Dyck words of length $n=2k+1$ (obtained by prefixing a 0-bit to each Dyck word of length $2k$ and used to reinterpret the Hamilton cycles in the odd graph $O_k$ and the middle-levels graph $M_k$ found by…
An algorithm counting the number of ones in a binary word is presented running in time $O(\log\log b)$ where $b$ is the number of ones. The operations available include bit-wise logical operations and multiplication.
A subsequence of a word $w$ is a word $u$ such that $u = w[i_1] w[i_2] \cdots w[i_k]$, for some set of indices $1 \leq i_1 < i_2 < \dots < i_k \leq \vert w \vert$. A word $w$ is \emph{$k$-subsequence universal} over an alphabet $\Sigma$ if…
In this paper we propose an algorithm to generate binary words with no more 0's than 1's having a fixed number of 1's and avoiding the pattern $(10)^j1$ for any fixed $j \geq 1$. We will prove that this generation is exhaustive, that is,…
A deterministic algorithm for factoring $n$ using $n^{1/3+o(1)}$ bit operations is presented. The algorithm tests the divisibility of $n$ by all the integers in a short interval at once, rather than integer by integer as in trial division.…
In this paper, we study a series of algorithmic problems related to the subsequences occurring in the strings of a given language, under the assumption that this language is succinctly represented by a grammar generating it, or an automaton…
We consider the recognition problem of the Dyck Language generalized for multiple types of brackets. We provide an algorithm with quantum query complexity $O(\sqrt{n}(\log n)^{0.5k})$, where $n$ is the length of input and $k$ is the maximal…
A word on $q$ symbols is a sequence of letters from a fixed alphabet of size $q$. For an integer $k\ge 1$, we say that a word $w$ is $k$-universal if, given an arbitrary word of length $k$, one can obtain it by removing entries from $w$. It…
The directed acyclic word graph (DAWG) of a string $y$ of length $n$ is the smallest (partial) DFA which recognizes all suffixes of $y$ with only $O(n)$ nodes and edges. In this paper, we show how to construct the DAWG for the input string…
We consider the problem of dictionary matching in a stream. Given a set of strings, known as a dictionary, and a stream of characters arriving one at a time, the task is to report each time some string in our dictionary occurs in the…
Let $0<k\in\mathbb{Z}$. We zipper-merge integer compositions with sums $k$ and $k+1$, equal number of parts and initial entries equal at least to 1 and 2, respectively. This yields bitstrings with two initial zeros, $k-1$ remaining zeros…
In this paper we establish some new results similar to Lagrange's four-square theorem. For example, we prove that any integer $n>1$ can be written as $w(5w+1)/2+x(5x+1)/2+y(5y+1)/2+z(5z+1)/2$ with $w,x,y,z\in\mathbb Z$. Let $a$ and $b$ be…
For any infinite word $w$ on a finite alphabet $A$, the complexity function $p_w$ of $w$ is the sequence counting, for each non-negative $n$, the number $p_w(n)$ of words of length $n$ on the alphabet $A$ that are factors of the infinite…
In this paper we present a really simple linear-time algorithm constructing a context-free grammar of size O(g log (N/g)) for the input string, where N is the size of the input string and g the size of the optimal grammar generating this…
We prove that for any sequence of binary alphabets $\mathcal{A}_1,\mathcal{A}_2,\dots$, there exists a cube-free word $c_1c_2\dots$ so that $c_1\in\mathcal{A}_1,c_2\in\mathcal{A}_2,\dots$. In particular, for every $n$, there are at least…
We show how to enumerate words in $1^{m_1} \dots n^{m_n}$ that avoid the increasing consecutive pattern $12 \dots r$ for any $r \geq 2$. Our approach yields an $O(n^{s+1})$ algorithm to enumerate words in $1^s \dots n^s$, avoiding the…
Suppose we want to seek the longest common subsequences (LCSs) of two strings as informative patterns that explain the relationship between the strings. The dynamic programming algorithm gives us a table from which all LCSs can be extracted…
We exhibit the construction of a deterministic automaton that, given k > 0, recognizes the (regular) language of k-differentiable words. Our approach follows a scheme of Crochemore et al. based on minimal forbidden words. We extend this…
We address the non-redundant random generation of $k$ words of length $n$ in a context-free language. Additionally, we want to avoid a predefined set of words. We study a rejection-based approach, whose worst-case time complexity is shown…
Assuming we are in a Word-RAM model with word size $w$, we show that we can construct in $o(w)$ time an error correcting code with a constant relative positive distance that maps numbers of $w$ bits into $\Theta(w)$-bit numbers, and such…