OFFSET
1,2
COMMENTS
LINKS
FORMULA
EXAMPLE
The 13th row of A301983 is: 1, 2, 3, 5, 6, 7, 13; all numbers in the range 1..3 appear in this row, but the number 4 is missing; hence a(13) = 3.
PROG
(PARI) a(n) = my (b=binary(n), s=Set(1)); for (i=2, #b, s = setunion(s, Set(apply(v -> 2*v+b[i], s)))); for (u=1, oo, if (!setsearch(s, u), return (u-1)))
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Mar 30 2018
STATUS
approved