Source author record

Jeffrey Shallit

Jeffrey Shallit appears in the imported research catalog. Authorship, coauthor and topic links are available while profile ownership is still unclaimed.

ResearcherUnclaimed source record

Catalog footprint

What is connected

68works
13topics
4close collaborators

Actions

Connect this record

Log in to claim

Research graph

See the researcher in context

Open full explorer

Inspect adjacent papers, topics, institutions and collaborators without losing the researcher page.

Building this map preview

BZPEER is loading the nearby papers, people, topics and institutions for this page.

Published work

68 published item(s)

preprint2022arXiv

Automatic Sequences in Negative Bases and Proofs of Some Conjectures of Shevelev

We discuss the use of negative bases in automatic sequences. Recently the theorem-prover Walnut has been extended to allow the use of base (-k) to express variables, thus permitting quantification over Z instead of N. This enables us to prove results about two-sided (bi-infinite) automatic sequences. We first explain the theory behind negative bases in Walnut. Next, we use this new version of Walnut to give a very simple proof of a strengthened version of a theorem of Shevelev. We use our ideas to resolve two open problems of Shevelev from 2017. We also reprove a 2000 result of Shur involving bi-infinite binary words.

preprint2022arXiv

Counterexamples to a Conjecture of Dombi in Additive Number Theory

We disprove a 2002 conjecture of Dombi from additive number theory. More precisely, we find examples of sets $A \subset \mathbb{N}$ with the property that $\mathbb{N} \setminus A$ is infinite, but the sequence $n \rightarrow |\{ (a,b,c) \, : \, n=a+b+c \text{ and } a,b,c \in A \}|$, counting the number of $3$-compositions using elements of $A$ only, is strictly increasing.

preprint2022arXiv

Quotients of Palindromic and Antipalindromic Numbers

A natural number N is said to be palindromic if its binary representation reads the same forwards and backwards. In this paper we study the quotients of two palindromic numbers and answer some basic questions about the resulting sets of integers and rational numbers. For example, we show that the following problem is algorithmically decidable: given an integer N, determine if we can write N = A/B for palindromic numbers A and B. Given that N is representable, we find a bound on the size of the numerator of the smallest representation. We prove that the set of unrepresentable integers has positive density in N. We also obtain similar results for quotients of antipalindromic numbers (those for which the first half of the binary representation is the reverse complement of the second half). We also provide examples, numerical data, and a number of intriguing conjectures and open problems.

preprint2022arXiv

Record-Setters in the Stern Sequence

Stern's diatomic series, denoted by $(a(n))_{n \geq 0}$, is defined by the recurrence relations $a(2n) = a(n)$ and $a(2n + 1) = a(n) + a(n + 1)$ for $n \geq 1$, and initial values $a(0) = 0$ and $a(1) = 1$. A record-setter for a sequence $(s(n))_{n \geq 0}$ is an index $v$ such that $s(i) < s(v)$ holds for all $i < v$. In this paper, we give a complete description of the record-setters for the Stern sequence.

preprint2021arXiv

Lie complexity of words

Given a finite alphabet $Σ$ and a right-infinite word $\bf w$ over $Σ$, we define the Lie complexity function $L_{\bf w}:\mathbb{N}\to \mathbb{N}$, whose value at $n$ is the number of conjugacy classes (under cyclic shift) of length-$n$ factors $x$ of $\bf w$ with the property that every element of the conjugacy class appears in $\bf w$. We show that the Lie complexity function is uniformly bounded for words with linear factor complexity, and as a result we show that words of linear factor complexity have at most finitely many primitive factors $y$ with the property that $y^n$ is again a factor for every $n$. We then look at automatic sequences and show that the Lie complexity function of a $k$-automatic sequence is again $k$-automatic.

preprint2020arXiv

An inequality for the number of periods in a word

We prove an inequality for the number of periods in a word x in terms of the length of x and its initial critical exponent. Next, we characterize all periods of the length-n prefix of a characteristic Sturmian word in terms of the lazy Ostrowski representation of n, and use this result to show that our inequality is tight for infinitely many words x. We propose two related measures of periodicity for infinite words. Finally, we also consider special cases where x is overlap-free or squarefree.

preprint2020arXiv

Badly approximable numbers, Kronecker's theorem, and diversity of Sturmian characteristic sequences

We give an optimal version of the classical ``three-gap theorem'' on the fractional parts of $n θ$, in the case where $θ$ is an irrational number that is badly approximable. As a consequence, we deduce a version of Kronecker's inhomogeneous approximation theorem in one dimension for badly approximable numbers. We apply these results to obtain an improved measure of sequence diversity for characteristic Sturmian sequences, where the slope is badly approximable.

preprint2020arXiv

Borders, Palindrome Prefixes, and Square Prefixes

We show that the number of length-n words over a k-letter alphabet having no even palindromic prefix is the same as the number of length-n unbordered words, by constructing an explicit bijection between the two sets. A slightly different but analogous result holds for those words having no odd palindromic prefix. Using known results on borders, we get an asymptotic enumeration for the number of words having no even (resp., odd) palindromic prefix . We obtain an analogous result for words having no nontrivial palindromic prefix. Finally, we obtain similar results for words having no square prefix, thus proving a 2013 conjecture of Chaffin, Linderman, Sloane, and Wilks.

preprint2020arXiv

Computational Aspects of Sturdy and Flimsy Numbers

Following Stolarsky, we say that a natural number n is flimsy in base b if some positive multiple of n has smaller digit sum in base b than n does; otherwise it is sturdy. We develop algorithmic methods for the study of sturdy and flimsy numbers. We provide some criteria for determining whether a number is sturdy. Focusing on the case of base b = 2, we study the computational problem of checking whether a given number is sturdy, giving several algorithms for the problem. We find two additional, previously unknown sturdy primes. We develop a method for determining which numbers with a fixed number of 0's in binary are flimsy. Finally, we develop a method that allows us to estimate the number of k-flimsy numbers with n bits, and we provide explicit results for k = 3 and k = 5. Our results demonstrate the utility (and fun) of creating algorithms for number theory problems, based on methods of automata theory.

preprint2020arXiv

Existential length universality

We study the following natural variation on the classical universality problem: given a language $L(M)$ represented by $M$ (e.g., a DFA/RE/NFA/PDA), does there exist an integer $\ell \geq 0$ such that $Σ^\ell \subseteq L(M)$? In the case of an NFA, we show that this problem is NEXPTIME-complete, and the smallest such $\ell$ can be doubly exponential in the number of states. This particular case was formulated as an open problem in 2009, and our solution uses a novel and involved construction. In the case of a PDA, we show that it is recursively unsolvable, while the smallest such $\ell$ is not bounded by any computable function of the number of states. In the case of a DFA, we show that the problem is NP-complete, and $e^{\sqrt{n \log n} (1+o(1))}$ is an asymptotically tight upper bound for the smallest such $\ell$, where $n$ is the number of states. Finally, we prove that in all these cases, the problem becomes computationally easier when the length $\ell$ is also given in binary in the input: it is polynomially solvable for a DFA, PSPACE-complete for an NFA, and co-NEXPTIME-complete for a PDA.

preprint2020arXiv

Extremal overlap-free and extremal $β$-free binary words

An overlap-free (or $β$-free) word $w$ over a fixed alphabet $Σ$ is extremal if every word obtained from $w$ by inserting a single letter from $Σ$ at any position contains an overlap (or a factor of exponent at least $β$, respectively). We find all lengths which admit an extremal overlap-free binary word. For every extended real number $β$ such that $2^+\leqβ\leq 8/3$, we show that there are arbitrarily long extremal $β$-free binary words.

preprint2020arXiv

New Bounds on Antipowers in Words

Fici et al. defined a word to be a k-power if it is the concatenation of k consecutive identical blocks, and an r-antipower if it is the concatenation of r pairwise distinct blocks of the same size. They defined N (k, r) as the smallest l such that every binary word of length l contains either a k-power or an r-antipower. In this note we obtain some new upper and lower bounds on N (k, r). We also consider avoiding 3-antipowers and 4-antipowers over larger alphabets, and obtain a lower bound for N (k, 5) in the binary case.

preprint2020arXiv

Robbins and Ardila meet Berstel

In 1996, Neville Robbins proved the amazing fact that the coefficient of $X^n$ in the Fibonacci infinite product $$ \prod_{n \geq 2} (1-X^{F_n}) = (1-X)(1-X^2)(1-X^3)(1-X^5)(1-X^8) \cdots = 1-X-X^2+X^4 + \cdots$$ is always either $-1$, $0$, or $1$. The same result was proved later by Federico Ardila using a different method. Meanwhile, in 2001, Jean Berstel gave a simple 4-state transducer that converts an "illegal" Fibonacci representation into a "legal" one. We show how to obtain the Robbins-Ardila result from Berstel's with almost no work at all, using purely computational techniques that can be performed by existing software.

preprint2020arXiv

Sumsets of Wythoff Sequences, Fibonacci Representation, and Beyond

Let $α= (1+\sqrt{5})/2$ and define the lower and upper Wythoff sequences by $a_i = \lfloor i α\rfloor$, $b_i = \lfloor i α^2 \rfloor$ for $i \geq 1$. In a recent interesting paper, Kawsumarng et al. proved a number of results about numbers representable as sums of the form $a_i + a_j$, $b_i + b_j$, $a_i + b_j$, and so forth. In this paper I show how to derive all of their results, using one simple idea and existing free software called Walnut. The key idea is that for each of their sumsets, there is a relatively small automaton accepting the Fibonacci representation of the numbers represented. I also show how the automaton approach can easily prove other results.

preprint2020arXiv

The State Complexity of Lexicographically Smallest Words and Computing Successors

Given a regular language L over an ordered alphabet $Σ$, the set of lexicographically smallest (resp., largest) words of each length is itself regular. Moreover, there exists an unambiguous finite-state transducer that, on a given word w, outputs the length-lexicographically smallest word larger than w (henceforth called the L-successor of w). In both cases, naive constructions result in an exponential blowup in the number of states. We prove that if L is recognized by a DFA with n states, then $2^{Θ(\sqrt{n \log n})}$ states are sufficient for a DFA to recognize the subset S(L) of L composed of its lexicographically smallest words. We give a matching lower bound that holds even if S(L) is represented as an NFA. We then show that the same upper and lower bounds hold for an unambiguous finite-state transducer that computes L-successors.

preprint2018arXiv

Subword complexity and power avoidance

We begin a systematic study of the relations between subword complexity of infinite words and their power avoidance. Among other things, we show that -- the Thue-Morse word has the minimum possible subword complexity over all overlap-free binary words and all $(\frac 73)$-power-free binary words, but not over all $(\frac 73)^+$-power-free binary words; -- the twisted Thue-Morse word has the maximum possible subword complexity over all overlap-free binary words, but no word has the maximum subword complexity over all $(\frac 73)$-power-free binary words; -- if some word attains the minimum possible subword complexity over all square-free ternary words, then one such word is the ternary Thue word; -- the recently constructed 1-2-bonacci word has the minimum possible subword complexity over all \textit{symmetric} square-free ternary words.

preprint2016arXiv

Discriminators and k-Regular Sequences

The discriminator of an integer sequence s = (s(i))_{i >=0}, introduced by Arnold, Benkoski, and McCabe in 1985, is the map D_s(n) that sends n >= 1 to the least positive integer m such that the n numbers s(0), s(1), ..., s(n-1) are pairwise incongruent modulo m. In this note we consider the discriminators of a certain class of sequences, the k-regular sequences. We compute the discriminators of two such sequences, the so-called "evil" and "odious" numbers, and show they are 2-regular. We also give an example of a k-regular sequence whose discriminator is not k-regular. Finally, we examine sequences that are their own discriminators, and count the number of length-$n$ finite sequences with this property.

preprint2016arXiv

Fractional coverings, greedy coverings, and rectifier networks

A rectifier network is a directed acyclic graph with distinguished sources and sinks; it is said to compute a Boolean matrix $M$ that has a $1$ in the entry $(i,j)$ iff there is a path from the $j$th source to the $i$th sink. The smallest number of edges in a rectifier network computing $M$ is a classic complexity measure on matrices, which has been studied for more than half a century. We explore two well-known techniques that have hitherto found little to no applications in this theory. Both of them build on a basic fact that depth-$2$ rectifier networks are essentially weighted coverings of Boolean matrices with rectangles. We obtain new results by using fractional and greedy coverings (defined in the standard way). First, we show that all fractional coverings of the so-called full triangular matrix have cost at least $n\log n$. This provides (a fortiori) a new proof of the tight lower bound on its depth-$2$ complexity (the exact value has been known since 1965, but previous proofs are based on different arguments). Second, we show that the greedy heuristic is instrumental in tightening the upper bound on the depth-$2$ complexity of the Kneser-Sierpiński (disjointness) matrix. The previous upper bound is $O(n^{1.28})$, and we improve it to $O(n^{1.17})$, while the best known lower bound is $Ω(n^{1.16})$. Third, using fractional coverings, we obtain a form of direct product theorem that gives a lower bound on unbounded-depth complexity of Kronecker (tensor) products of matrices. In this case, the greedy heuristic shows (by an argument due to Lovász) that our result is only a logarithmic factor away from the "full" direct product theorem. Our second and third results constitute progress on open problem 7.3 and resolve, up to a logarithmic factor, open problem 7.5 from a recent book by Jukna and Sergeev (in Foundations and Trends in Theoretical Computer Science (2013)).

preprint2015arXiv

An Unusual Continued Fraction

We consider the real number $σ$ with continued fraction expansion $[a_0, a_1, a_2,\ldots] = [1,2,1,4,1,2,1,8,1,2,1,4,1,2,1,16,\ldots]$, where $a_i$ is the largest power of $2$ dividing $i+1$. We compute the irrationality measure of $σ^2$ and demonstrate that $σ^2$ (and $σ$) are both transcendental numbers. We also show that certain partial quotients of $σ^2$ grow doubly exponentially, thus confirming a conjecture of Hanna and Wilson.

preprint2015arXiv

Closed, Palindromic, Rich, Privileged, Trapezoidal, and Balanced Words in Automatic Sequences

We prove that the property of being closed (resp., palindromic, rich, privileged trapezoidal, balanced) is expressible in first-order logic for automatic (and some related) sequences. It therefore follows that the characteristic function of those n for which an automatic sequence x has a closed (resp., palindromic, privileged, rich, trape- zoidal, balanced) factor of length n is automatic. For privileged words this requires a new characterization of the privileged property. We compute the corresponding characteristic functions for various famous sequences, such as the Thue-Morse sequence, the Rudin-Shapiro sequence, the ordinary paperfolding sequence, the period-doubling sequence, and the Fibonacci sequence. Finally, we also show that the function counting the total number of palindromic factors in a prefix of length n of a k-automatic sequence is not k-synchronized.

preprint2015arXiv

Factorization in Formal Languages

We consider several novel aspects of unique factorization in formal languages. We reprove the familiar fact that the set uf(L) of words having unique factorization into elements of L is regular if L is regular, and from this deduce an quadratic upper and lower bound on the length of the shortest word not in uf(L). We observe that uf(L) need not be context-free if L is context-free. Next, we consider variations on unique factorization. We define a notion of "semi-unique" factorization, where every factorization has the same number of terms, and show that, if L is regular or even finite, the set of words having such a factorization need not be context-free. Finally, we consider additional variations, such as unique factorization "up to permutation" and "up to subset".

preprint2014arXiv

Decision Algorithms for Fibonacci-Automatic Words, with Applications to Pattern Avoidance

We implement a decision procedure for answering questions about a class of infinite words that might be called (for lack of a better name) "Fibonacci-automatic". This class includes, for example, the famous Fibonacci word f = 01001010..., the fixed point of the morphism 0 -> 01 and 1 -> 0. We then recover many results about the Fibonacci word from the literature (and improve some of them), such as assertions about the occurrences in f of squares, cubes, palindromes, and so forth. As an application of our method we prove a new result: there exists an aperiodic infinite binary word avoiding the pattern x x x^R. This is the first avoidability result concerning a nonuniform morphism proven purely mechanically.

preprint2014arXiv

Mechanical Proofs of Properties of the Tribonacci Word

We implement a decision procedure for answering questions about a class of infinite words that might be called (for lack of a better name) "Tribonacci-automatic". This class includes, for example, the famous Tribonacci word T = 0102010010202 ..., the fixed point of the morphism 0 -> 01, 1 -> 02, 2 -> 0. We use it to reprove some old results about the Tribonacci word from the literature, such as assertions about the occurrences in T of squares, cubes, palindromes, and so forth. We also obtain some new results.

preprint2014arXiv

Notes and Note-Pairs in Noergaard's Infinity Series

The Danish composer Per Noergaard defined the "infinity series" s = (s(n))_n>=0 by the rules s(0) = 0, s(2n) = -s(n) for n >= 1, and s(2n + 1) = s(n) + 1 for n >= 0; it figures prominently in many of his compositions. Here we give several new results about this sequence: first, the set of binary representations of the positions of each note forms a context-free language that is not regular; second, a complete characterization of exactly which note-pairs appear; third, that consecutive occurrences of identical phrases are widely separated. We also consider to what extent the infinity series is unique.

preprint2014arXiv

Similarity density of the Thue-Morse word with overlap-free infinite binary words

We consider a measure of similarity for infinite words that generalizes the notion of asymptotic or natural density of subsets of natural numbers from number theory. We show that every overlap-free infinite binary word, other than the Thue-Morse word t and its complement t bar, has this measure of similarity with t between 1/4 and 3/4. This is a partial generalization of a classical 1927 result of Mahler.

preprint2014arXiv

Three Series for the Generalized Golden Mean

As is well-known, the ratio of adjacent Fibonacci numbers tends to phi = (1 + sqrt(5))/2, and the ratio of adjacent Tribonacci numbers (where each term is the sum of the three preceding numbers) tends to the real root eta of X^3 - X^2 - X - 1 = 0. Letting alpha(n) denote the corresponding ratio for the generalized Fibonacci numbers, where each term is the sum of the n preceding, we obtain rapidly converging series for alpha(n), 1/alpha(n), and 1/(2-alpha(n)).

preprint2013arXiv

Remarks on Privileged Words

We discuss the notion of privileged word, recently introduced by Peltomaki. A word w is privileged if it is of length <=1, or has a privileged border that occurs exactly twice in w. We prove the following results: (1) if w^k is privileged for some k >=1, then w^j is privileged for all j >= 0; (2) the language of privileged words is neither regular nor context-free; (3) there is a linear-time algorithm to check if a given word is privileged; and (4) there are at least 2^{n-5}/n^2 privileged binary words of length n.

preprint2013arXiv

Repetition Avoidance in Circular Factors

We consider the following novel variation on a classical avoidance problem from combinatorics on words: instead of avoiding repetitions in all factors of a word, we avoid repetitions in all factors where each individual factor is considered as a "circular word", i.e., the end of the word wraps around to the beginning. We determine the best possible avoidance exponent for alphabet size 2 and 3, and provide a lower bound for larger alphabets.

preprint2013arXiv

Sets Represented as the Length-n Factors of a Word

In this paper we consider the following problems: how many different subsets of Sigma^n can occur as set of all length-n factors of a finite word? If a subset is representable, how long a word do we need to represent it? How many such subsets are represented by words of length t? For the first problem, we give upper and lower bounds of the form alpha^(2^n) in the binary case. For the second problem, we give a weak upper bound and some experimental data. For the third problem, we give a closed-form formula in the case where n <= t < 2n. Algorithmic variants of these problems have previously been studied under the name "shortest common superstring".

preprint2012arXiv

Enumerating regular expressions and their languages

In this chapter we discuss the problem of enumerating distinct regular expressions by size and the regular languages they represent. We discuss various notions of the size of a regular expression that appear in the literature and their advantages and disadvantages. We consider a formal definition of regular expressions using a context-free grammar. We then show how to enumerate strings generated by an unambiguous context-free grammar using the Chomsky-Schützenberger theorem. This theorem allows one to construct an algebraic equation whose power series expansion provides the enumeration. Classical tools from complex analysis, such as singularity analysis, can then be used to determine the asymptotic behavior of the enumeration. We use these algebraic and analytic methods to obtain asymptotic estimates on the number of regular expressions of size n. A single regular language can often be described by several regular expressions, and we estimate the number of distinct languages denoted by regular expressions of size n. We also give asymptotic estimates for these quantities. For the first few values, we provide exact enumeration results.

preprint2012arXiv

Filtrations of Formal Languages by Arithmetic Progressions

A filtration of a formal language L by a sequence s maps L to the set of words formed by taking the letters of words of L indexed only by s. We consider the languages resulting from filtering by all arithmetic progressions. If L is regular, it is easy to see that only finitely many distinct languages result. By contrast, there exist CFL's that give infinitely many distinct languages as a result. We use our technique to show that the operation diag, which extracts the diagonal of words of square length arranged in a square array, preserves regularity but does not preserve context-freeness.

preprint2012arXiv

Least periods of k-automatic sequences

Currie and Saari initiated the study of least periods of infinite words, and they showed that every integer n >= 1 is a least period of the Thue-Morse sequence. We generalize this result to show that the characteristic sequence of least periods of a k-automatic sequence is (effectively) k-automatic. Through an implementation of our construction, we confirm the result of Currie and Saari, and we obtain similar results for the period-doubling sequence, the Rudin-Shapiro sequence, and the paperfolding sequence.

preprint2012arXiv

Primitive Words and Lyndon Words in Automatic and Linearly Recurrent Sequences

We investigate questions related to the presence of primitive words and Lyndon words in automatic and linearly recurrent sequences. We show that the Lyndon factorization of a k-automatic sequence is itself k-automatic. We also show that the function counting the number of primitive factors (resp., Lyndon factors) of length n in a k-automatic sequence is k-regular. Finally, we show that the number of Lyndon factors of a linearly recurrent sequence is bounded.

preprint2012arXiv

Subword Complexity and k-Synchronization

We show that the subword complexity function p_x(n), which counts the number of distinct factors of length n of a sequence x, is k-synchronized in the sense of Carpi if x is k-automatic. As an application, we generalize recent results of Goldstein. We give analogous results for the number of distinct factors of length n that are primitive words or powers. In contrast, we show that the function that counts the number of unbordered factors of length n is not necessarily k-synchronized for k-automatic sequences.

preprint2011arXiv

A Pattern Sequence Approach to Stern's Sequence

Let w be a binary string and let a_w (n) be the number of occurrences of the word w in the binary expansion of n. As usual we let s(n) denote the Stern sequence; that is, s(0)=0, s(1)=1, and for n >= 1, s(2n)=s(n) and s(2n+1)=s(n)+s(n+1). In this note, we show that s(n) = a_1 (n) + \sum_{w in 1 (0+1)*} s([w bar]) a_{w1} (n) where w bar denotes the complement of w (obtained by sending 0 to 1 and 1 to 0, and [w] denotes the integer specified by the word w interpreted in base 2.

preprint2011arXiv

Enumeration and Decidable Properties of Automatic Sequences

We show that various aspects of k-automatic sequences -- such as having an unbordered factor of length n -- are both decidable and effectively enumerable. As a consequence it follows that many related sequences are either k-automatic or k-regular. These include many sequences previously studied in the literature, such as the recurrence function, the appearance function, and the repetitivity index. We also give some new characterizations of the class of k-regular sequences. Many results extend to other sequences defined in terms of Pisot numeration systems.

preprint2011arXiv

Kuratowski's Theorem for Two Closure Operators

A celebrated 1922 theorem of Kuratowski states that there are at most 14 distinct sets arising from applying the operations of complementation and closure, any number of times, in any order, to a subset of a topological space. In this paper we consider the case of complementation and two abstract closure operators. In contrast to the case of a single closure operation, we show that infinitely many distinct sets can be generated, even when the closure operators commute.

preprint2011arXiv

The Critical Exponent is Computable for Automatic Sequences

The critical exponent of an infinite word is defined to be the supremum of the exponent of each of its factors. For k-automatic sequences, we show that this critical exponent is always either a rational number or infinite, and its value is computable. Our results also apply to variants of the critical exponent, such as the initial critical exponent of Berthe, Holton, and Zamboni and the Diophantine exponent of Adamczewski and Bugeaud. Our work generalizes or recovers previous results of Krieger and others, and is applicable to other situations; e.g., the computation of the optimal recurrence constant for a linearly recurrent k-automatic sequence.

preprint2010arXiv

Inverse Star, Borders, and Palstars

A language L is closed if L = L*. We consider an operation on closed languages, L-*, that is an inverse to Kleene closure. It is known that if L is closed and regular, then L-* is also regular. We show that the analogous result fails to hold for the context-free languages. Along the way we find a new relationship between the unbordered words and the prime palstars of Knuth, Morris, and Pratt. We use this relationship to enumerate the prime palstars, and we prove that neither the language of all unbordered words nor the language of all prime palstars is context-free.

preprint2010arXiv

Thue-Morse at Multiples of an Integer

Let (t_n) be the classical Thue-Morse sequence defined by t_n = s_2(n) (mod 2), where s_2 is the sum of the bits in the binary representation of n. It is well known that for any integer k>=1 the frequency of the letter "1" in the subsequence t_0, t_k, t_{2k}, ... is asymptotically 1/2. Here we prove that for any k there is a n<=k+4 such that t_{kn}=1. Moreover, we show that n can be chosen to have Hamming weight <=3. This is best in a twofold sense. First, there are infinitely many k such that t_{kn}=1 implies that n has Hamming weight >=3. Second, we characterize all k where the minimal n equals k, k+1, k+2, k+3, or k+4. Finally, we present some results and conjectures for the generalized problem, where s_2 is replaced by s_b for an arbitrary base b>=2.