OFFSET
1,1
COMMENTS
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10000
EXAMPLE
20 in binary is 10100. A030101(20) = 5, which is 00101 = 101 in binary. The positive integers that occur as substrings of 10100 when written in binary are 1 (1 in binary), 2 (10 in binary), 4 (100 in binary), 5 (101 in binary), 10 (1010 in binary), and 20 (10100 in binary). The binary substring with the largest decimal value not present in (00)101 is 100, which is 4 in decimal. So a(20) = 4.
PROG
(PARI) in(abc, b) = my (m=2^#binary(b)); while (abc >= b, if (abc%m==b, return (1), abc\=2)); return (0)
for (v=1, 91, my (w=fromdigits(Vecrev(binary(v)), 2)); if (v!=w, for (k=1, oo, if (in(v, k) && !in(w, k), print1 (k ", "); break)))) \\ Rémy Sigrist, Nov 08 2018
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Leroy Quet, Apr 28 2010
EXTENSIONS
More terms from Rémy Sigrist, Nov 08 2018
STATUS
approved