OFFSET
1,3
COMMENTS
a(n) is the least integer k such that t(k*n) = 1, where t(i) is the Thue-Morse sequence.
From Robert G. Wilson v, Sep 29 2010: (Start)
k must always be odd.
First occurrence of odd ks: 1, 23, 5, 3, 9, 99, 325, 315, 17, 15, 3021, 195, 189, 645, 2313, 2295, 33, 7695, 1785, 1799, 105, 387, 23529, 5643, ..., .
Records occur at n: 1, 3, 9, 15, 33, 63, 129, 255, 513, 1023, 2049, 4095, 8193, 16383, 32769, 65535, 131073, 262143, ..., . (End)
In their paper Morgenbesser et al. prove a(n) <= n+4. They also prove that, for all n>=1, it is possible to find a k such that A010060(k*n) = 1, with k <= n+4 and Hamming weight of k <= 3. That sequence differs from the current sequence at n=195, 315, 387, 390, 630, 645, 765, 771, 774, 780, ... - Michel Marcus, Jan 24 2016
LINKS
Michel Marcus, Table of n, a(n) for n = 1..10000
Johannes F. Morgenbesser, Jeffrey Shallit, Thomas Stoll, Thue-Morse at multiples of an integer, Journal of Number Theory, Volume 131, Issue 8, August 2011, Pages 1498-1512.
EXAMPLE
For n = 3 the sequence has value 7, since 21 is 10101 in base 2, with an odd number of 1's, and no smaller multiple works.
MATHEMATICA
f[n_] := Block[{k = 1}, While[ EvenQ@ DigitCount[k*n, 2, 1], k++ ]; k]; Array[f, 105] (* Robert G. Wilson v, Sep 29 2010 *)
PROG
(PARI) a(n) = {my(k = 1); while (hammingweight(k*n) % 2 != 1, k++); k; } \\ Michel Marcus, Jan 23 2016
(Python)
def a(n):
k = 1
while not bin(k*n).count("1")%2 == 1: k += 1
return k
print([a(n) for n in range(1, 81)]) # Michael S. Branicky, Feb 22 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Jeffrey Shallit, Jun 10 2010
STATUS
approved