OFFSET
1,1
COMMENTS
LINKS
N. J. A. Sloane, Table of n, a(n) for n = 1..19999
MATHEMATICA
b[1] = 1;
b[n_] := b[n] = Module[{bits, k}, bits = IntegerDigits[b[n-1], 2]; For[k = 1, True, k++, If[SequencePosition[bits, IntegerDigits[k, 2]] == {}, Return[b[n-1] + k]]]];
a[n_] := b[n+1] - b[n];
Array[a, 100] (* Jean-François Alcover, Aug 02 2018 *)
PROG
(Python)
A261018_list, a = [], 1
for i in range(10**3):
b, s = 1, format(a, 'b')
while format(b, 'b') in s:
b += 1
a += b
s = format(a, 'b')
A261018_list.append(b) # Chai Wah Wu, Aug 26 2015
(Haskell)
a261018 n = a261018_list !! (n-1)
a261018_list = zipWith (-) (tail a260273_list) a260273_list
-- Reinhard Zumkeller, Aug 30 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Aug 17 2015
STATUS
approved