The sum of digits functions of the Zeckendorf and the base phi expansions
Michel Dekking, F.
DOI
10.1016/j.tcs.2021.01.011
Publication date
2021
Document Version
Final published version
Published in
Theoretical Computer Science
Citation (APA)
Michel Dekking, F. (2021). The sum of digits functions of the Zeckendorf and the base phi expansions.
Theoretical Computer Science, 859, 70-79. https://doi.org/10.1016/j.tcs.2021.01.011
Important note
To cite this publication, please use the final published version (if applicable).
Please check the document version above.
Copyright
Other than for strictly personal use, it is not permitted to download, forward or distribute the text or part of it, without the consent of the author(s) and/or copyright holder(s), unless the work is under an open content license such as Creative Commons. Takedown policy
Please contact us and provide details if you believe this document breaches copyrights. We will remove access to the work immediately and investigate your claim.
Theoretical Computer Science 859 (2021) 70–79
Contents lists available atScienceDirect
Theoretical
Computer
Science
www.elsevier.com/locate/tcs
The
sum
of
digits
functions
of
the
Zeckendorf
and
the
base
phi
expansions
F. Michel Dekking
DIAM,DelftUniversityofTechnology,FacultyEEMCS,P.O.Box5031,2600GADelft,theNetherlands
a
r
t
i
c
l
e
i
n
f
o
a
b
s
t
r
a
c
t
Articlehistory:
Received6August2020
Receivedinrevisedform23November2020 Accepted5January2021
Availableonline8January2021 CommunicatedbyM.Sciortino Keywords: Zeckendorfexpansion Basephi Wythoffsequence Fibonacciword
GeneralizedBeattysequence
We consider the sum of digits functions for both base phi, and for the Zeckendorf expansionofthenaturalnumbers.Forbothsumofdigitsfunctionswepresentmorphisms oninfinitealphabetssuchthatthesefunctionsviewedasinfinitewordsareletter-to-letter projectionsoffixedpointsofthesemorphisms.Wecharacterizethefirstdifferencesofboth functionsa)withgeneralizedBeattysequences,orunionsofgeneralizedBeattysequences, andb)withmorphicsequences.
©2021TheAuthor(s).PublishedbyElsevierB.V.Thisisanopenaccessarticleunderthe CCBYlicense(http://creativecommons.org/licenses/by/4.0/).
1. Introduction
PerhapsthemostfamouswordinlanguagetheoryistheThue-Morseword s2
:=
0110100110010110. . . ,
fixed point ofthe morphism
μ
:
0→
01,
1→
10.Here a morphismis a map frominfinitewords toinfinite wordsthat preservesthe concatenationoperationonthe setofwords.The remarkablepropertyof s2 is thatit canalsobe obtained frombinaryexpansions:s2(
N)
givestheparityofthesumofdigitsinthebinary expansionofthenaturalnumberN.The sumofdigitsinbase2writtenasaninfinitewordequalssTM
:=
0112122312232334, . . . ,
andsTMisfixedpointofthemorphism j
→
j,
j+
1 ontheinfinitealphabet{
0,
1,
2,
. . .
}
.Thereasonforthisissimple:the number2N hasthesamenumberofdigitsasN,and2N+
1 hasonemoredigitthanN.Thequestionarises:dosimilarconnectionstolanguagetheoryholdforexpansionsinotherbases? Forexpansionsinintegerbasesb,b anaturalnumber,itisnothardtoestablishthattheanswerispositive.
Inthispaperweconsiderthecasewherethepowersof2arereplacedbytheFibonaccinumbers(theZeckendorfexpansion), respectivelythepowersofthegoldenmean
ϕ
= (
1+
√
5)/
2 (thebasephiexpansion).Forbothexpansionswegive inTheorem3,respectivelyTheorem11a morphismonan infinitealphabet,suchthat the sumofdigits functionsof theseexpansionsconsideredasinfinitewords are letter-to-letterprojections offixedpoints of
E-mailaddress:F.M.Dekking@TUDelft.nl.
https://doi.org/10.1016/j.tcs.2021.01.011
0304-3975/©2021TheAuthor(s).PublishedbyElsevierB.V.ThisisanopenaccessarticleundertheCCBYlicense (http://creativecommons.org/licenses/by/4.0/).
these morphisms. This means that the sumof digits functionsare morphic words, defined in generalas letter-to-letter projectionsoffixedpointsofmorphisms.
We then willshow how theseresults permit to give precise informationon thefirst differencesofthe sumof digits functions.Thefirstdifferences ofafunction f
: N
0→ N
0aregivenbythefunctionf definedby
f
(
N)
=
f(
N+
1)
−
f(
N),
for N=
0,
1,
2. . . .
Weshallfocusonthesignsof
f .AnumberN iscalledapointofincrease ofafunction f
: N
0→ N
0 iff
(
N)
>
0.Itis calledapointofconstancy iff
(
N)
=
0,andapointofdecrease iff
(
N)
<
0.For basetwo it is simple to seethat the points ofincrease of the sumof digits function sTM are given by the even numbers,andthatthepointsofconstancyanddecreasearegivenbythenumbers1 mod 4,respectively3 mod 4.
Wewillprove(Theorem4andTheorem12)forboththeZeckendorfrepresentationandthebasephiexpansionthatthe pointsofincrease,constancyanddecreaseareallgivenbyunionsofgeneralizedBeattysequences,asstudiedin[1].These aresequences V ofthetype
V
(
n)
=
pnα
+
q n+
r,
n≥
1,
where
α
isarealnumber,andp,
q,andr areintegers.Herewedenotedthefloorfunctionby·
.Wewillalsoprovethatthefirstdifferencesofthesequencesofpointsofincrease,constancyanddecreaseareallmorphic sequences.SeeTheorem5fortheZeckendorfrepresentation,andTheorem13forthebasephiexpansion.
Aprominentrole inthispaper, bothforbasephiandthe Zeckendorfexpansion, isplayed by
(
nϕ
)
,the well known lowerWythoffsequence.A standard result(see, e.g., [14]) isthat the sequence
(
nϕ
)
is equalto the Fibonacciword x1,2=
1211212112. . .
onthealphabet{
1,
2}
,i.e., theuniquefixedpointofthemorphism1→
12,
2→
1.Moregenerally,wehavethefollowing simplelemma.Lemma 1. ([1]) Let V
= (
V(
n))
n≥1bethegeneralizedBeattysequencedefinedbyV(
n)
=
pnϕ
+
qn+
r,andletV bethesequence
ofitsfirstdifferences.Then
V istheFibonacciwordonthealphabet
{
2p+
q,
p+
q}
.Conversely,ifxa,bistheFibonacciwordonthealphabet
{
a,
b}
,thenanyV withV
=
xa,bisageneralizedBeattysequenceV= ((
a−
b)
nϕ
)
+ (
2b−
a)
n+
r)
forsomeintegerr.Let A
(
n)
=
nϕ
,andB(
n)
=
nϕ
2.Itiswellknownthat A and B formapairofBeattysequences,i.e.,theyaredisjoint withunion
N
.Inthenextlemma,V A isthecompositiongivenbyV A(
n)
=
V(
A(
n))
.Lemma 2. ([1]) Let V beageneralizedBeattysequencegivenbyV
(
n)
=
pnϕ
+
qn+
r,n≥
1.ThenV A andV B aregeneralized Beattysequenceswithparameters(
pV A,
qV A,
rV A)
= (
p+
q,
p,
r−
p)
and(
pV B,
qV B,
rV B)
= (
2p+
q,
p+
q,
r)
.2. The Zeckendorf sum of digits function
Let F0
=
0,
F1=
1,
F2=
1,
. . .
betheFibonaccinumbers.Ignoringleadingandtrailingzeros,anynaturalnumberN can bewrittenuniquelywithdigitsdi=
0 or1,asN
=
i≥0 diFi+2
,
wheredidi+1
=
11 isnotallowed.WedenotetheZeckendorfexpansionofN asZ(
N)
,withdigitsdi(
N)
.LetsZbethesumofdigitsofsuchanexpansion:forN
≥
0 sZ(
N)
=
i≥0 di(
N).
Wehave(
sZ(
N))
= (
0,
1,
1,
1,
2,
1,
2,
2,
1,
2,
2,
2,
3,
1,
2,
2,
2,
3,
2,
3,
3,
1,
2,
2,
2, . . . )
Ourfirst resultis that sZ isa morphic sequence.Thealphabet willconsist ofsymbols j 0 and j 1. Notethatin the theorem
j 0j+1 1
isawordoflength2overthisalphabet.
Theorem 3. ThefunctionsZ,asasequence,isamorphicsequenceonaninfinitealphabet,i.e.,
(
sZ(
N))
isalettertoletterprojectionofF. Michel Dekking Theoretical Computer Science 859 (2021) 70–79
τ
(
j 0)
=
j 0j+1 1
,
τ
(
j 1)
=
j 0.
Theletter-to-lettermapisgivenbytheprojectiononthefirstcoordinate:
j i→
j fori=
0,
1.Thefixedpointxτ ofτ
withinitial symbol00
projectedonthefirstcoordinateequals
(
sZ(
N))
.Proof. See theCommentsofsequenceA007895in[15] foraproofofthis.
LetIZ
,
CZandDZ bethefunctionslistingthepointsofincrease,constancy,anddecreaseofthefunctionsZ.Wehave1 IZ= (
0,
3,
5,
8,
11,
13,
16, . . . ),
CZ= (
1,
2,
6,
9,
10,
14, . . . ),
DZ= (
4,
7,
12,
17,
20,
25, . . . ).
TostateourresultsitisactuallyconvenienttodefineDZ
= (−
1,
4,
7,
12,
17,
20,
25,
. . . )
.When
(
an)
and(
bn)
are two increasing sequences, indexed byN
, then we mean by the union of(
an)
and(
bn)
theincreasingsequencewhosetermsgothroughtheset
{
an,
bn:
n∈ N}
.Theorem 4. ThefunctionIZ,thepointsofincreaseofthefunctionsZ,isgivenforn
=
1,
2,
. . .
by IZ(
n)
=
nϕ
+
n−
2.
ThefunctionCZ,thepointsofconstancyofthefunctionsZ,isgivenforn
=
1,
2,
. . .
bytheunionofthetwogeneralizedBeattysequenceswithterms
2
nϕ
+
n−
2 and 3nϕ
+
2n−
3.
ThefunctionDZ,thepointsofdecreaseofthefunctionsZ,isgivenforn
=
1,
2. . .
by DZ(
n)
=
2nϕ
+
n−
4.
Proof. Let IZ bethesequenceofthepointsofincreaseofthefunctionsZ.
Projectiononthesecondcoordinateof
τ
yieldstheFibonaccimorphismσ
Fgivenbyσ
F(
0)
=
01,
σ
F(
1)
=
0.
Thus thesecond coordinatesof thefixedpoint of
τ
equaltheinfiniteFibonacciword x0,1 =0100101001001....Obviously, theincrease points ofsZ occurifandonlyiftheword(
j,
0)
(
j+
1,
1)
occursinthe fixedpoint xτ ofτ
ifandonlyifthe word 01occursin x0,1. Since11 doesnot occur inx0,1,this meansthat we haveto shiftthe positionsof 1’sin x0,1 by 1.Itis wellknownthat thepositionsof1are givenbytheupperWythoff sequence(
nϕ
2)
= (
nϕ
+
n)
.Sincethe first coordinateofthefixedpointofτ
startsfromindex0,andthesecondfromindex1,wehavetoreplacen byn+
1,andthis yieldsthefirstresultofTheorem4.Thepointsofconstancyaremoredifficulttocharacterizewiththefixedpointxτ thanthepointsofincrease.We there-foretakeanotherapproach.Write Z
(
N)
= . . .
w,wherew isawordoflength4.Then w canbeanywordofthe0-1-words oflength4containingno11.Obviously,thethreewords w=
0000,
w=
0100 and w=
1000 givepointsofincrease.FurthermorethenumbersN with Z
(
N)
endinginw=
0001,
1001 andw=
0010 giveZ
(
N)
= . . .
001⇒
Z(
N+
1)
= . . .
.
002= . . .
.
010,
Z(
N)
= . . .
0010⇒
Z(
N+
1)
= . . .
.
0011= . . .
.
0100.
Weseethatthesegivepointsofconstancy.Finally,we show thatthe N with Z
(
N)
having suffix w=
0101 or w=
1010 givepoints ofdecrease.Inthe following twocomputationsthe=
.
-signindicatesthatweusealsonon-admissibleZeckendorfrepresentations.Z
(
N)
= . . .
0101⇒
Z(
N+
1)
= . . .
.
0102= . . .
.
0110= . . .
.
1000,
Z(
N)
= . . .
01010⇒
Z(
N+
1)
= . . .
.
01011= . . .
.
01100= . . .
.
10000.
Inbothcasesatleastonedigit1islost,sotheseN arethepointsofdecrease.Withthisknowledge we canapply Theorem2.3 andProposition 2.8inthe paper[9],obtaining that one partof IZ is givenbythegeneralizedBeattysequence
(
2nϕ
+
n−
2)
andtheotherpartisgivenby(
3nϕ
+
2n−
3)
.1 I
ZisthesequenceA026274in[15].
Again from Theorem 2.3 and Proposition 2.8 in the paper [9], we obtain that
(
DZ(
n+
1))
is the union of the two generalizedBeattysequences(
3nϕ
+
2n−
1)
and(
5nϕ
+
3n−
1)
.ItisnotasimplemattertoseethatthisunionisgivenbythesinglegeneralizedBeattysequence
(
2nϕ
+
n−
4)
,where theindexstartsatn=
2.Let us write V
(
p,
q,
r)
= (
pnϕ
+
qn+
r)
n≥1. We have proved so far that IZ=
V(
1,
1,
−
2)
, and CZ is the union ofV
(
2,
1,
−
2)
andV(
3,
2,
−
3)
.Ifweadd2toalltermsofthesesequences,weobtainthethreesequencesV(
1,
1,
0)
,V(
2,
1,
0)
, andV(
3,
2,
−
1)
.Thetripleofsequences
{
V(
1,
1,
0),
V(
2,
1,
0),
V(
1,
1,
−
1)
}
isknownasthe‘firstclassicalcomplementarytriple’,i.e.,thesearethreedisjointsequenceswithunion
N
.Seepage334in [1].Thethirdsequenceofthistriple,V(
1,
1,
−
1)
,canbewrittenasadisjointunionofthetwosequences V(
3,
2,
−
1)
andV
(
2,
1,
−
2)
,byLemma2.Thus{
V(
1,
1,
0),
V(
2,
1,
0),
V(
3,
2,
−
1),
V(
2,
1,
−
2)
}
formsacomplementaryquadruple.Ifwesubtract2fromalltermsofthesefoursequences,thefirstgivesIZ,thesecondand thethirdtogether,CZ.Since
{
IZ,
CZ,
DZ}
isacomplementarytriple,withunion{−
1,
0,
1,
2,
. . .
}
thisimpliesthat(
DZ(
n+
1))
hastobeequalto V(
2,
1,
−
4)
.Next,wegiveacharacterizationofIZ
,
CZandDZ intermsofmorphisms.Theorem 5. ThepointsofincreaseofthefunctionsZaregivenbythesequenceIZ,whichhasIZ
(
1)
=
0,andIZisthefixedpointof
theFibonaccimorphism3
→
32,
2→
3.ThepointsofconstancyofthefunctionsZaregivenbythesequenceCZ,whichhasCZ
(
1)
=
1,andCZisthefixedpointofthe
2-blockFibonaccimorphismonthealphabet
{
1,
4,
3}
givenby1→
14,
3→
14,
4→
3.ThepointsofdecreaseofthefunctionsZaregivenbythesequenceDZ,whichhasDZ
(
1)
= −
1,andDZisthefixedpointofthe
Fibonaccimorphism5
→
53,
3→
5.FortheproofofTheorem5wehavetomakesomepreparations.Let
3
:= {
2},
3
:= {
0,
1}
=: [
0,
1]
,anddefineforn≥
4 theintervalsofintegersn and
n by
n
:= [
Fn,
Fn+1−
1],
n:= [
0,
Fn−
1].
The
(
n)
formapartitionofN
0\ {
0,
1}
,andthe(
n)
satisfyn+1
=
n∪
n.
(1)ForanintervalI,letCZ
(
I)
denotethepoints ofincreaselyingintheinterval I.Also,letCZ
(
I)
denotethefirstdifferences ofthepoints ofincrease lyinginthe interval I,consideredasa wordon thealphabet{
1,
2,
3,
4}
.Atfirstsight,the latter definitionisproblematic,asonehastoknowthefirstpointofincreaseafterthelast elementofCZ(
I)
.However,we shall onlyconsiderintervalsI=
n andI=
n+1,whichbotharefollowedbyn+1,andoneverifieseasilythatthefirstpoint ofincreasein
n+1 isalwaysthesecondpoint.Actually,thisfollowsdirectlyfromthefollowinglemma.
Lemma 6. Foralln
≥
3 onehasCZ(
n+1)
=
CZ(
n)
+
Fn+1.Proof. We used the notation A
+
y= {
x+
y:
x∈
A}
for a set A, anda number y. The lemma follows from the basic Zeckendorfrecursion:thenumbersN inn+1 allhaveadigit1addedtotheexpansionofthenumberN
−
Fn+1.Leth bethemorphismonthealphabet
{
1,
3,
4}
givenby h(
1)
=
14,
h(
3)
=
14,
h(
4)
=
3.
Proposition 7. Foralln
≥
5 onehas (i)CZ
(
n)
=
hn−4(
3)
(
ii)
CZ
(
n)
=
hn−5(
3)
.Proof. The proof isby induction. Forn
=
5,we have5
= [
0,
4]
,which hastwo points of constancy: N=
1 and N=
2. ThereforeCZ(
5)
=
14=
h(
3)
.Herethedifference4iscomingfromN=
6,thesecondpointoftheinterval5.Wefurther have
5
= [
5,
7]
,whichhasonepointofconstancyN=
6.ThereforeCZ(
5)
=
3.F. Michel Dekking Theoretical Computer Science 859 (2021) 70–79
(i)Byequation(1),
CZ
(
n+1)
=
CZ(
n)
CZ(
n)
=
hn−4(
3)
hn−5(
3)
=
hn−5(
h(
3)
3)
=
hn−5(
143)
=
hn−5(
h2(
3))
=
hn−3(
3).
(ii)DirectlyfromLemma6:
CZ
(
n+1)
=
CZ(
n)
=
hn−4(
3)
.Proof of Theorem5. The statementsonIZandDZfollowimmediatelyfromLemma1.
ThestatementonCZ followsfromProposition7,part(i),sincehn
(
3)
=
hn(
1)
foralln>
0. 3. The base phi expansionAnaturalnumberN iswritteninbasephi([2])ifN hastheform N
=
∞
i=−∞
di
ϕ
i,
withdigits di
=
0 or1,andwheredidi+1=
11 isnotallowed. Ignoring leadingandtrailing0’s,thesumisactually finite, andthebasephirepresentationofanumberN isunique([2]).Wewritetheseexpansionsas
β(
N)
=
dLdL−1. . .
d1d0·
d−1d−2. . .
dR+1dR.
LetforN≥
0 sβ(
N)
:=
k=R k=L dk(
N)
bethesumofdigitsfunctionofthebasephiexpansions.Wehave
(
sβ(
N))
= (
0,
1,
2,
2,
3,
3,
3,
2,
3,
4,
4,
5,
4,
4,
4,
5,
4,
4,
2,
3,
4,
4,
5,
5,
5,
4,
5,
6,
6,
7,
5,
5,
5,
6, . . . ).
Thecaseofbasephiisconsiderablymorecomplicatedthan theZeckendorfcase. Weneedseveralpreparations,before wecanproveTheorem11inSection3.2,Theorem12inSection3.3andTheorem13inSection3.4.
3.1. Therecursivestructuretheorem
Theresultofthissectionwasanticipatedin[10],[11],and[16],andprovedin[8]. TheLucasnumbers
(
Ln)
= (
2,
1,
3,
4,
7,
11,
18,
29,
47,
76,
123,
. . . )
aredefinedbyL0
=
2,
L1=
1,
Ln=
Ln−1+
Ln−2 for n≥
2.
Forn
≥
2 weareinterestedinthreeconsecutiveintervalsgivenby In:= [
L2n+1+
1,
L2n+1+
L2n−2−
1],
Jn
:= [
L2n+1+
L2n−2,
L2n+1+
L2n−1],
Kn:= [
L2n+1+
L2n−1+
1,
L2n+2−
1].
To formulate the next theorem,it is notationally convenient to extendthe semigroup of words to the free group of words.Forexample,onehas110−101−100
=
100.Theorem 8. [Recursive Structure Theorem] I For all n
≥
1 and k=
1,
. . . ,
L2n−1 one hasβ(
L2n+
k)
= β(
L2n)
+ β(
k)
=
10. . .
0β(
k)
0. . .
01.IIForalln
≥
2 andk=
1,
. . . ,
L2n−2−
1In
: β(
L2n+1+
k)
=
1000(
10)
−1β(
L2n−1+
k)(
01)
−11001,
Kn: β(
L2n+1+
L2n−1+
k)
=
1010(
10)
−1β(
L2n−1+
k)(
01)
−10001.
Moreover,foralln
≥
2 andk=
0,
. . . ,
L2n−3Jn
: β(
L2n+1+
L2n−2+
k)
=
10010(
10)
−1β(
L2n−2+
k)(
01)
−1001001.
74Itis crucialtoouranalysisto partitionthenaturalnumbersinwhatwe calltheLucas intervals,givenby
0
:= [
0,
1]
, andforn=
1,
2. . .
by2n
:= [
L2n,
L2n+1],
2n+1:= [
L2n+1+
1,
L2n+2−
1].
IfI
= [
k,
]
and J= [
+
1,
m]
aretwoadjacentintervalsofintegers,thenwewriteI J= [
k,
m]
.WecodetheLucasintervalswithfoursymbols
0,1,2 and3 (forextrareadabilitythesesymbolsareincolorinthe webversionofthisarticle),byacodeinthefollowingway:
(
0)
=
0,(
1)
=
1,(
2)
=
2,(
3)
=
3.
We thencode
(
4)
= (
0)(
1)(
2)
=
012,(
5)
= (
3)(
2)(
3)
=
323,andingeneralby induc-tion,suggestedbyTheorem8:(
2n+2)
= (
0)(
1)(
2) . . .
(
2n),
(
2n+1)
= (
2n−1)(
2n−2)(
2n−1).
Let
σ
bethemorphismonthealphabet{
0,1,2,3}
definedbyσ
(
0)
=
01,
σ
(
1)
=
23,
σ
(
2)
=
012,
σ
(
3)
=
323.
Lemma 9. Foreachn≥
0 wehave(
2n+2)
=
σ
n(
2)
,(
2n+3)
=
σ
n(
3)
.Proof. By induction.Forn
=
0:(
2)
=
2,(
3)
=
3.Theinductionstep:(
2n+5)
=
(2n+3)
(
2n+2)
(
2n+3)
=
σ
n(3)σ
n(2)
σ
n(3)
=
σ
n+1(3). Also,usingthesimpleidentity
σ
(2)3σ
(2)=
σ
2(2)inthelaststep:
(
2n+4)
= (
0)(
1)(
2)
. . .(
2n)(
2n+1)(
2n+2)
= (
2n+2)(
2n+1)(
2n+2)
=
σ
n(2)
σ
n−1(3)
σ
n(2)
=
σ
n+1(2)
Wewillnowshowthatthefixedpointxσ ofthemorphism
σ
isquasi-Sturmian,anddetermineitscomplexityfunctionpσ ,i.e., pσ
(
n)
isthenumberofwordsoflengthn thatoccursinxσ .Letga,b themorphismonthealphabet{
a,
b}
givenbyga,b
(
a)
=
baa,
ga,b(
b)
=
ba.
(2)Themorphismga,biswell-known,andcloselyrelatedtotheFibonaccimorphism.Infact,xg
=
bxa,b,ifxg isthefixedpointof ga,b,andxa,bisthefixedpointoftheFibonaccimorphisma
→
ab,
b→
a (see[3]).Proposition 10. Thefixedpointxσ of
σ
isequaltothedecorationδ(
xg)
ofthefixedpointxgofg=
ga,b.Thedecorationmorphismδ
isgivenby
δ(
a)
=
23,δ(
b)
=
01.Foralln≥
1 onehaspσ(
n)
=
n+
3. Proof. For thetwowords01 and23 occurringinxσ wefindσ
(
01)
=
0123,
σ
(
23)
=
012323.
Inotherwords,σ
(δ(
a))
= δ(
baa)
= δ(
g(
a)),
σ
(δ(
b))
= δ(
ba)
= δ(
g(
b)).
Thusσ
δ
= δ
g,whichimpliesσ
nδ
= δ
gn foralln.Sincexσ hasprefix
01= δ(
b)
,withb theprefixofxg,thisimpliesthefirstpartoftheproposition.
For the second part, Proposition 8 in [4] is not conclusive, as we do not know a priori the constant n0. But there is a direct computation possible. The complexity function of the Sturmian word xg is given by p
(
n)
=
n+
1. We have,distinguishing betweenwords ofeven andodd length, andthen splitting accordingto words occurring ateven orodd positionsinxσ ,
pσ
(
2n)
=
p(
n)
+
p(
n+
1)
=
n+
1+
n+
2=
2n+
3,
pσ(
2n+
1)
=
p(
n+
1)
+
p(
n+
1)
=
2n+
4.
Proposition 10 incombination withthe main resultof the paper[13], explains whythe factors of xσ have a simple returnwordstructure.ThisliesatthebasisofTheorem12inSection3.3.
F. Michel Dekking Theoretical Computer Science 859 (2021) 70–79
3.2. Amorphicsequencerepresentationofsβ
Theimageunderamorphism
δ
ofthefixedpointx ofamorphism,willbecalledadecoration ofx.Itiswellknownthat suchaδ(
x)
isamorphicsequence,i.e.,thelettertoletterprojectionofthefixedpointofamorphism.Thisisthewaywe formulatethemorphicsequenceresultinthenexttheorem.Theorem 11. Thefunctionsβ,asasequence,isadecorationofamorphicsequenceonaninfinitealphabet,i.e.,
(
sβ(
N))
isanimageunderamorphism
δ
ofafixedpointofamorphismγ
.Thealphabetis{
0,
1,
...,
j,
...}
× {
0,
1,
2,3}
,andγ
isthemorphismgiven forj≥
0 byγ
(
j 0)
=
j 0j 1
,
γ
(
j 1)
=
j 2j 3
,
γ
(
j 2)
=
j+2 0j+2 1
j+2 2
,
γ
(
j 3)
=
j+1 3j+2 2
j+1 3
.
Thedecorationmapisgivenbythemorphism
δ
:δ(
j 0)
=
0+
j,
1+
j,
δ(
j 1)
=
2+
j,
δ(
j 2)
=
2+
j,
3+
j,
δ(
j 3)
=
3+
j,
3+
j.
Theimage
δ(
xγ)
ofthefixedpointxγ ofγ
withinitialsymbol 0 0equals
(
sβ(
N))
.Proof. One combinesTheorem8withLemma9.Weseefrompart I ofTheorem8,thatthenumberof1’sintheexpansion of N from
2n+2 is2more thanthe numberof1’s inthecorresponding N in
0
1
. . .
2n. Thisgivesthethree upper indices j+
2 inγ
(
j 2)
.Similarly,part II givesthatthenumberof1’sinthethree intervals2n−1,
2n−2,and
2n−1 is increasedby1,by2,andrespectively1forthecorresponding Nintheinterval
2n+1.Thisgivesthethreeupperindices in
γ
(
j 3)
.The lower indices aregivenby the morphismσ
.Thisall happensatthe levelof theshifted versionsofthe fourintervals0
,
1
,
2and
3.Here
0
= [
0,
1]
withsβ(
0)
=
0andsβ(
1)
=
1;1
= {
2}
withsβ(
2)
=
2;2
= [
3,
4]
withsβ
(
3)
=
2andsβ(
4)
=
3;3
= [
5,
6]
withsβ(
5)
=
3andsβ(
6)
=
3.Thisyields thedecorationsδ
,takingintoaccountthecorrespondingincrementsofthesumofdigits.
WeillustrateTheorem11withthefollowingtable.N 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
sβ
(
N)
0 1 2 2 3 3 3 2 3 4 4 5 4 4 4 5 4 4Lucas interval
0
1
2
3
4
5
shifted Lucas intervals
0
1
2
3
0
1
2
3
2
3 0,1,2,3-coding 0 1 2 3 012 323
Remark. Inthepaper[7] the basephianalogueoftheThue-Morsesequence,i.e., thesequence
(
sβ(
N)
mod 2)
,isshowntobeamorphicsequence.ThisresultfollowsalsofromTheorem11,bymapping2 j to0,and2 j
+
1 to1.Themorphisms foundinthiswayareonalargeralphabetthanthemorphismin[7].3.3. GeneralizedBeattysequencesforsβ
LetIβ bethesequencelistingthepointsofincreaseofsβ
(
N)
.Weseethatthefirstsixpointsofincreaseare Iβ(
1)
=
0,Iβ
(
2)
=
1, Iβ(
3)
=
3,Iβ(
4)
=
7, Iβ(
5)
=
8,Iβ(
6)
=
10.SimilarlywedefineCβ andDβ.Theorem 12. ThesequenceIβ,thepointsofincreaseofthefunctionsβ,isgivenbytheunionofthetwogeneralizedBeattysequences
(
nϕ
+
2n)
n≥0,
and(
4nϕ
+
3n+
1)
n≥0.
ThesequenceCβ,thepointsofconstancyofthefunctionsβ,isgivenbytheunionofthefourgeneralizedBeattysequences
(
3nϕ
+
n+
1)
n≥1, (
4nϕ
+
3n+
2)
n≥0, (
7nϕ
+
4n+
2)
n≥0,
and(
11nϕ
+
7n+
4)
n≥1.
ThesequenceDβ,thepointsofdecreaseofthefunctionsβ,isgivenbytheunionofthethreegeneralizedBeattysequences
(
4nϕ
+
3n−
1)
n≥1, (
7nϕ
+
4n)
n≥1,
and(
7nϕ
+
4n+
4)
n≥1.
Proof. I: Points of increase
Anyoccurrenceofa
0 givestwopointsofincrease,namelythepair0+
j,
1+
j,andthepair1+
j,
2+
j.Hereweuse that0 isalwaysfollowedby1.Similarly,anyoccurrenceofa2 givesapointofincrease2+
j,
3+
j.AsaconsequenceweobtainthenumbersN whicharepointofincreasebythesequencesofoccurrencesof
0,andthose of2.Howdoweobtainthesesequences?Wehavetostudythereturnwordsto0,and2.Thesetsofthesereturnwords arerespectively{
0123, 012323}
,and{
23, 2301}
.Both
0, and 2 induce the descendant morphism ga,b (the descendant morphism is a generalization of the derivedmorphism,see[12]).Herewecodedb
:=
0123,a:=
012323,respectivelyb:=
23,a:=
2301.Theoccurrencesof
0 inthefixedpointofσ
occuratdistancesgivenbythelengthsofδ(
0123)andδ(
012323). Theseare|δ(
0123)| =
7,and|δ(
012323)| =
11.It thenfollowsfromLemma1that theincrease pointsare given bytheunionofthetwogeneralizedBeattysequences V(
4,
3,
0)
andV(
4,
3,
1)
,wheretheindicatesthatthesestartfrom index0.Similarly,theoccurrencesof2 havefirstdifferences7and4,givingthegeneralizedBeattysequence V(
3,
1,
−
1)
.This isnot yetthe first resultinTheorem 12,butby Lemma2 thesequence V
(
1,
2,
0)
splits into the twosequencesV
(
3,
1,
−
1)
andV(
4,
3,
0)
.AddingN=
0 toV(
1,
2,
0)
andtoV(
4,
3,
0)
thenyieldstheresulton Iβ inTheorem12.II: Points of constancy
Anyoccurrenceofa
1 givesapointofconstancy, namelythepair2+
j,
2+
j. Hereweusethat1 isalways followed by2.Similarly,anyoccurrenceofa3 givesapointofconstancy3+
j,
3+
j.But there are more points of constancy. At the inner boundary of
2
3 in the quadruple
0
1
2
3 occurs 3
,
3. However,thisisnotthecaseattheinnerboundaryoftheinterval2
3inthetriple
3
2
3 in
5.Since
(
02
3
4
)
=
01σ
(
1)
,and(
32
3
)
=
σ
(
3)
thesepointsofconstancyoccurifandonlyifσ
(
1)
occursinthefixedpointofσ
. This still doesnot yet exhaust all possibilities:there is thepoint N=
14 with sβ(
N)
=
sβ(
N+
1)
=
4 in5, not yet covered bythe previous sequences.Thisinduces points ofconstancy occurringatallshifted
5,whichoccur ifandonly if
σ
(
3)
occursinthefixedpoint ofσ
.Sinceanyk fork
>
5 canbe writtenasaunionofshiftedversionsofthethreeintervals
0
1
2
3,
4,and
5,wehavecoveredallpossibilities.
As a consequence we obtain the numbers N which are point ofincrease by the sequences of occurrences of
1, 3,σ
(
1),andσ
(
3)
.As before,all fourhavea setoftwo returnwords,anda descendantmorphism thatis equalto g.For 1 theδ
-imageshavelengths11and7,for3 theδ
-imageshavelengths7and4,forσ
(
1)
,theδ
-imageshavelengths29 and18,andforσ
(
3)
theδ
-imageshavelengths18and11.ApplicationofLemma1thengivesthefourgeneralizedBeatty sequencesofCβ inTheorem12.III: Points of decrease
The first point of decrease is N
=
6, which occursat the endof3, so N
+
1=
7 occurs atthe beginning of4
=
0
1
2.Thisgivesoccurrencesofpointsofdecreaseateveryoccurrenceof30.Thiswordhastworeturnwords:b
:=
3012,anda:=
301232.These induceasdescendant morphismthe morphism g,oncemore. As|δ(
a)
|
=
11,and|δ(
b)|
=
7,thisleadstothesequenceV(
4,
3,
−
1)
.The next point of decrease is at N
=
11, occurringat the inner boundary ofthe adjacent4
5. The third point of decreaseisatN
=
15,whichliesinside5.Thecodingof
5 is
(
5)
=
323 =σ
(
3)
.Asintheprevioussection,this givesthesequence V(
7,
4,
0)
fortheoccurrencesofthedecreasepoints N=
11,andlatershifts.Then V(
7,
4,
4)
givesthe occurrencesofthedecreasepointsN=
15=
11+
4,andlatershifts.Again,sinceanykfork
>
5 canbewrittenasaunionofintervals
0
1
2
3,
4,and
5,wehavecoveredallpossibilities.Thisfinishesthe Dβ partofTheorem12.
3.4. Morphismsforthefirstdifferences
AsfortheZeckendorfexpansion,wehaveseenintheprevioussectionthatthepointsofconstancyhaveamore compli-catedstructurethanthepointsofincreaseorthepointsofdecrease.Thisphenomenonexpressesitselfalsointhe‘morphic versions’ofthecharacterization.
Theorem 13. ThepointsofincreaseofthefunctionsβaregivenbythesequenceIβ,whichhasIβ
(
1)
=
0,andIβisthefixedpointof
themorphismonthealphabet
{
1,
2,
4}
givenby1
→
12,
2→
4,
4→
1244.
ThepointsofconstancyofthefunctionsβaregivenbythesequenceCβ,whichhasCβ
(
1)
=
2,andCβisamorphicsequence,givenby
theletter-to-letterprojection1
→
1,
2→
2,
3→
3,
3→
3,
4→
4 ofthefixedpointofthemorphismonthealphabet{
1,
2,
3,
3,
4}
givenby
F. Michel Dekking Theoretical Computer Science 859 (2021) 70–79
ThepointsofdecreaseofthefunctionsβaregivenbythesequenceDβ,whichhasDβ
(
1)
=
6,andDβistheshiftbyoneofthefixed
pointsof themorphismonthealphabet
{
2,
4,
5,
7}
givenby2
→
542,
4→
542,
5→
7,
7→
7542.
Proof. We use in all three cases the return words to
0 which are b:=
0123 anda:=
012323 to follow the occurrencesofthepointsofincrease,constancyanddecrease.Theimportantpropertyofthesereturnwordsisthatthefirstoccurrenceofthepointsofincreaseisatthesamepositioninthedecorateda andb,andthesameholdsforthepointsof constancyanddecrease.
Proof. I: Points of increase
Wetakeintoaccounttheincreaseinthedifferencesoftheoccurrencesoftheincreasepointsinthedecorations
δ(
j 0j 1
j 2
j 3
)
=
0+
j,
1+
j,
2+
j,
2+
j,
3+
j,
3+
j,
3+
j,δ(
j 0j 1
j 2
j 3
j 2
j 3
)
=
0+
j,
1+
j,
2+
j,
2+
j,
3+
j,
3+
j,
3+
j,
2+
j,
3+
j,
3+
j,
3+
j,oftheextendedreturnwordsa andb.Fora thesedifferencesare1
,
2,
4 and4.Forb thedifferencesbetweentheoccurrences oftheincrease points are1,
2,and4.Recall here,that thelast4 comesfromthefirstincrease pointofthenext word.It followsthat wecanobtainIβ bydecoratingthefixed pointofthemorphism g givenbya
→
baa,
b→
ba withthetwowords124and1244.Toturnthisdecoratedfixedpointintoafixedpoint,weapplythenaturalalgorithm(cf.theproofof Corollary9in[5]).Inthiscasethisgivesthefollowingblockmaponthealphabet
{
a1,
a2,
a3,
a4,
b1,
b2,
b3}
:a1a2a3a4
→
b1b2b3a1a2a3a4a1a2a3a4 b1b2b3→
b1b2b3a1a2a3a4.
Themostefficientwaytoturnthisintoamorphism: a1
→
b1b2,
a2→
b3,
a3→
a1a2a3a4,
a4→
a1a2a3a4 b1→
b1b2,
b2→
b3,
b3→
a1a2a3a4.
The associated letter-to-letter map
λ
is givenbyλ(
a1a2a3a4)
=
1244,λ(
b1b2b3)
=
124.We see that we can consistently mergea1 andb1totheletter1,a2 andb2 totheletter2,anda3 andb3totheletter4.Renaminga4 by4,thisthenyields themorphism1→
12,
2→
4,
4→
1244 asgeneratingmorphismforIβ.
II: Points of constancy
We follow thesame strategy asin part I. The differencesof the occurrencesof points of constancy inthe decorated versionsofa andb arenow 2
,
1,
4 and3,
1,
3,
4.Decoratingthefixed pointofthemorphism g on{
a,
b}
bya→
214,andb
→
3134 thistimeleadstoamorphismonthealphabet{
1,
2,
3,
3,
4}
givenby1
→
43,
2→
21,
3→
21,
3→
1343,
4→
134.
The letter-to-letterprojection 1
→
1,
2→
2,
3→
3,
3→
3,
4→
4 of thefixedpoint ofthismorphismonthealphabet{
1,
2,
3,
3,
4}
yieldsthesequenceCβ (whereCβ
(
1)
=
2).III: Points of decrease
Thedifferencesoftheoccurrencesofpointsofdecreaseinthedecoratedversionsofa andb are7and5
,
4,
2.Decorating the fixed point ofthemorphism ga,b by a→
7,andb→
542 thistime leads to a morphismon the alphabet{
2,
4,
5,
7}
givenby
2
→
542,
4→
542,
5→
7,
7→
7542.
The uniquefixed pointofthismorphism onthealphabet
{
2,
4,
5,
7}
yields thesequenceDβ,whenwe put Dβ
(
1)
=
−
1.4. Alternative proofs of Theorem12and 13
TheproofsofTheorem12and13havebeenbasedentirelyonthepropertiesoftheinfinitemorphism
γ
ofTheorem11. The question rises whether thereis also amore local approachbased on thedigit blocks ofthe expansion aswas used for thepoints ofconstancy, andthe points of decrease ofthe Zeckendorf sumof digits function. Here we give a sketch of howthismight be achievedforthe points ofincrease ofthe basephiexpansion. We saya number N is oftype B ifd1d0d−1
(
N)
=
000,andoftypeE ifd2d1d0(
N)
=
001.Onecanthenprovethefollowing. 78Proposition 14. AnumberN isapointofincreaseof
(
sβ(
N))
ifandonlyifN isoftypeB oroftypeE.Next,Theorem 5.1fromthepaper[6] gives that type B occursalong thegeneralizedBeatty sequence
(
nϕ
+
2n)
n≥0, andonecandeducefromRemark6.3inthesamepaperthattypeE occursalongthegeneralizedBeattysequence(
4nϕ
+
3n+
1)
n≥0.ThisgivesthealternativeproofoftheIB-partofTheorem12,basedonProposition14.Wenextgiveaproofofthe
IB partofTheorem13,directlyfromTheorem12byapurelycombinatorialargument. Alternative proof of Theorem13. Let
IB
:= (
nϕ
+
2n)
n≥0,
IE:= (
4nϕ
+
3n+
1)
n≥0.
By Lemma 1, the difference sequence of the sequence
(
nϕ
+
2n,
n≥
1)
is equal to the Fibonacci word x4,3=
4344344344. . .
on the alphabet{
4,
3}
, and the difference sequence of the sequence(
4nϕ
+
3n+
1,
n≥
1)
is the Fi-bonacciwordx11,7=
11,
7,
11,
11,
7,
. . .
.However,inTheorem12thesequences startatn=
0,yieldingthetwodifference sequencesIB
=
3x4,3=
34344344344. . . ,
IE
=
7x11,7=
7,
11,
7,
11,
11,
7, . . . .
Recallthatthesequencesbxa,barefixedpointsofthemorphisms ga,bfromEquation(2) givenbyga,b
(
a)
=
baa,ga,b(
b)
=
ba.Thereturnwordsof3in
IB are34and344.Wecodethesewordsby thedifferencesthattheyyieldbetweensuccessive occurrencesof3’s,i.e.,bytheletters7and11.Then,since
g4,3
(
34)
=
34 344,
g4,3(
344)
=
34 344 344,
thereturnwordsinduceaderivedmorphism7
→
7,
11,
11→
7,
11,
11.
Thisderivedmorphismhappenstobeequaltog11,7,themorphismgivingthesequence
IE.Thisimpliesthattomergethe twosequences IB andIE toobtain I,onehastoreplacethe3’sin
IB by1
,
2.ThisdecorationofIB,inducesamorphism
μ
onthealphabet{
1,
2,
4}
intheusualway,givenbyμ
(
1)
=
12,
μ
(
2)
=
4,
μ
(
4)
=
1244.
Thisprovesthetheorem.Declaration of competing interest
The authors declare that they haveno known competingfinancial interests or personal relationships that could have appearedtoinfluencetheworkreportedinthispaper.
References
[1] J.-P.Allouche,F.M.Dekking,GeneralizedBeattysequencesandcomplementarytriples,Mosc.J.Comb.NumberTheory8(2019)325–342,https:// doi.org/10.2140/moscow.2019.8.325.
[2]G.Bergman,Anumbersystemwithanirrationalbase,Math.Mag.31(1957)98–110.
[3]J.Berstel,P.Séébold,AremarkonmorphicSturmianwords,RAIROTheor.Inform.Appl.28(1994)255–263.
[4]J.Cassaigne,Sequenceswithgroupedfactors,in:DLT’97,DevelopmentsinLanguageTheoryIII,Thessaloniki,AristotleUniversityofThessaloniki,1998, pp. 211–222.
[5] F.M.Dekking,Morphicwords,BeattysequencesandintegerimagesoftheFibonaccilanguage,Theor.Comput.Sci.809(2019)407–417,https://doi.org/ 10.1016/j.tcs.2019.12.036.
[6]F.M.Dekking,Basephirepresentationsandgoldenmeanbeta-expansions,FibonacciQ.58(2020)38–48.
[7]M.Dekking,Thesumofdigitsfunctionofthebasephiexpansionofthenaturalnumbers,Integers20 (#A45)(2020)1–6.
[8]F.MichelDekking,Howtoaddtwonaturalnumbersinbasephi,FibonacciQ.(2021),inpress.
[9]F.MichelDekking,ThestructureofZeckendorfexpansions,arXiv:2006.06970v1,2020,toappearinIntegers(2021).
[10]E.Hart,Onusingpatternsinthebeta-expansionstostudyFibonacci-Lucasproducts,FibonacciQ.36(1998)396–406.
[11]E.Hart,L.Sanchis,OntheoccurrenceofFnintheZeckendorfdecompositionofnFn,FibonacciQ.37(1999)21–33.
[12]C.Holton,L.Q.Zamboni,Descendantsofprimitivesubstitutions,TheoryComput.Syst.32(1999)133–157.
[13]Y.Huang,Z.Y.Wen,ThesequenceofreturnwordsoftheFibonaccisequence,Theor.Comput.Sci.593(2015)106–116.
[14]M.Lothaire,AlgebraicCombinatoricsonWords,CambridgeUniversityPress,2002.
[15] On-lineencyclopediaofintegersequences,foundedbyN.J.A.Sloane,electronicallyavailableathttp://oeis.org.