OFFSET
1,2
LINKS
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
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Jun 09 2024
STATUS
approved