In mathematics and theoretical computer science , a k -regular sequence is an infinite sequence of terms characterized by a finite automaton with auxiliary storage.[ 1] They are a generalization of k -automatic sequences to alphabets of infinite size.
Definition
Let
k
≥
2
{\displaystyle k\geq 2}
.
An integer sequence
s
(
n
)
n
≥
0
{\displaystyle s(n)_{n\geq 0}}
is k -regular if the set of sequences
{
s
(
k
e
n
+
r
)
n
≥
0
:
e
≥
0
and
0
≤
r
≤
k
e
−
1
}
{\displaystyle \{s(k^{e}n+r)_{n\geq 0}:e\geq 0{\text{ and }}0\leq r\leq k^{e}-1\}}
is contained in a finite-dimensional vector space over the field of rational numbers.
Examples
Ruler sequence
Let
s
(
n
)
=
ν
2
(
n
+
1
)
{\displaystyle s(n)=\nu _{2}(n+1)}
be the
2
{\displaystyle 2}
-adic valuation of
n
+
1
{\displaystyle n+1}
. The ruler sequence
s
(
n
)
n
≥
0
=
0
,
1
,
0
,
2
,
0
,
1
,
0
,
3
,
…
{\displaystyle s(n)_{n\geq 0}=0,1,0,2,0,1,0,3,\dots }
(OEIS : A007814 ) is
2
{\displaystyle 2}
-regular, and the set
{
s
(
2
e
n
+
r
)
n
≥
0
:
e
≥
0
and
0
≤
r
≤
2
e
−
1
}
{\displaystyle \{s(2^{e}n+r)_{n\geq 0}:e\geq 0{\text{ and }}0\leq r\leq 2^{e}-1\}}
is contained in the
2
{\displaystyle 2}
-dimensional vector space generated by
s
(
n
)
n
≥
0
{\displaystyle s(n)_{n\geq 0}}
and the constant sequence
1
,
1
,
1
,
…
{\displaystyle 1,1,1,\dots }
. These basis elements lead to the recurrence equations
s
(
2
n
)
=
0
s
(
4
n
+
1
)
=
s
(
2
n
+
1
)
−
s
(
n
)
s
(
4
n
+
3
)
=
2
s
(
2
n
+
1
)
−
s
(
n
)
,
{\displaystyle {\begin{aligned}s(2n)&=0\\s(4n+1)&=s(2n+1)-s(n)\\s(4n+3)&=2s(2n+1)-s(n),\end{aligned}}}
which, along with initial conditions
s
(
0
)
=
0
{\displaystyle s(0)=0}
and
s
(
1
)
=
1
{\displaystyle s(1)=1}
, uniquely determine the sequence.
Thue–Morse sequence
Every k -automatic sequence is k -regular.[ 2] For example, the Thue–Morse sequence
T
(
n
)
n
≥
0
=
0
,
1
,
1
,
0
,
1
,
0
,
0
,
1
,
…
{\displaystyle T(n)_{n\geq 0}=0,1,1,0,1,0,0,1,\dots }
is
2
{\displaystyle 2}
-regular, and
{
T
(
2
e
n
+
r
)
n
≥
0
:
e
≥
0
and
0
≤
r
≤
2
e
−
1
}
{\displaystyle \{T(2^{e}n+r)_{n\geq 0}:e\geq 0{\text{ and }}0\leq r\leq 2^{e}-1\}}
consists of the two sequences
T
(
n
)
n
≥
0
{\displaystyle T(n)_{n\geq 0}}
and
T
(
2
n
+
1
)
n
≥
0
=
1
,
0
,
0
,
1
,
0
,
1
,
1
,
0
,
…
{\displaystyle T(2n+1)_{n\geq 0}=1,0,0,1,0,1,1,0,\dots }
.
Polynomial sequences
If
f
(
x
)
{\displaystyle f(x)}
is an integer-valued polynomial , then
f
(
n
)
n
≥
0
{\displaystyle f(n)_{n\geq 0}}
is k -regular for every
k
≥
2
{\displaystyle k\geq 2}
.
Properties
The class of k -regular sequences is closed under termwise addition and multiplication.[ 3]
The n th term in a k -regular sequence grows at most polynomially in n .[ 4]
Generalizations
The notion of a k -regular sequence can be generalized to a ring
R
{\displaystyle R}
as follows. Let
R
′
{\displaystyle R'}
be a commutative Noetherian subring of
R
{\displaystyle R}
. A sequence
s
(
n
)
n
≥
0
{\displaystyle s(n)_{n\geq 0}}
with values in
R
{\displaystyle R}
is
(
R
′
,
k
)
{\displaystyle (R',k)}
-regular if the
R
′
{\displaystyle R'}
-module generated by
{
s
(
k
e
n
+
r
)
n
≥
0
:
e
≥
0
and
0
≤
r
≤
k
e
−
1
}
{\displaystyle \{s(k^{e}n+r)_{n\geq 0}:e\geq 0{\text{ and }}0\leq r\leq k^{e}-1\}}
is finitely generated.
Notes
^ Allouche & Shallit (1992), Theorem 4.4
^ Allouche & Shallit (1992), Theorem 2.3
^ Allouche & Shallit (1992), Theorem 2.5
^ Allouche & Shallit (1992), Theorem 2.10
References
Allouche, Jean-Paul; Shallit, Jeffrey (1992), "The ring of k -regular sequences" , Theoretical Computer Science , 98 : 163– 197, doi :10.1016/0304-3975(92)90001-v .
Allouche, Jean-Paul; Shallit, Jeffrey (2003), "The ring of k -regular sequences, II" , Theoretical Computer Science , 307 : 3– 29, doi :10.1016/s0304-3975(03)00090-2 .
Allouche, Jean-Paul; Shallit, Jeffrey (2003). Automatic Sequences: Theory, Applications, Generalizations . Cambridge University Press . ISBN 978-0-521-82332-6 . Zbl 1086.11015 .