OFFSET
1,2
COMMENTS
See A112509 for a full explanation and example.
LINKS
2008/9 British Mathematical Olympiad Round 2, Problem 4, Jan 29 2009.
PROG
(Python)
from itertools import product
def c(w):
return len(set(w[i:j+1] for i in range(len(w)) if w[i] != "0" for j in range(i, len(w)))) + int("0" in w)
def a(n):
if n == 1: return 0
m = -1
for b in product("01", repeat=n-1):
v = c("1"+"".join(b))
if v > m:
m, argm = v, int("1"+"".join(b), 2)
return argm
print([a(n) for n in range(1, 21)]) # Michael S. Branicky, Jan 13 2023
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Rick L. Shepherd, Sep 09 2005
EXTENSIONS
a(21)-a(31) from Joseph Myers, Feb 01 2009
STATUS
approved