login
A373553
For any number m, let m* be the bi-infinite string obtained by repetition of the binary expansion of m; a(n) is the largest positive integer k such that the binary expansions of all positive integers <= k are found within n*.
2
1, 2, 1, 2, 3, 3, 1, 2, 4, 2, 3, 4, 3, 3, 1, 2, 4, 2, 4, 2, 3, 3, 3, 4, 4, 3, 3, 4, 3, 3, 1, 2, 4, 2, 4, 2, 6, 6, 4, 2, 6, 2, 3, 6, 3, 3, 3, 4, 4, 6, 4, 6, 3, 3, 3, 4, 4, 3, 3, 4, 3, 3, 1, 2, 4, 2, 4, 2, 6, 6, 4, 2, 4, 2, 7, 4, 6, 7, 4, 2, 6, 2, 7, 2, 3, 3, 3
OFFSET
1,2
FORMULA
a(n) >= A144016(n).
a(2^k - 1) = 1 for any k > 0.
EXAMPLE
For n = 9: the binary expansion of 9 is "1001", 9* looks like "...10011001..." and contains the binary expansions of 1, 2, 3 and 4, but not of 5, so a(9) = 4.
PROG
(PARI) \\ See Links section.
(Python)
def a(n):
mstar = bin(n)[2:]*2
knot = next(k for k in range(2, n+2) if bin(k)[2:] not in mstar)
return knot - 1
print([a(n) for n in range(1, 88)]) # Michael S. Branicky, Jun 14 2024
CROSSREFS
Sequence in context: A071766 A007305 A112531 * A100002 A348330 A328471
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Jun 09 2024
STATUS
approved