This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A033015 #55 Oct 23 2022 01:33:51 %S A033015 3,7,12,15,24,28,31,48,51,56,60,63,96,99,103,112,115,120,124,127,192, %T A033015 195,199,204,207,224,227,231,240,243,248,252,255,384,387,391,396,399, %U A033015 408,412,415,448,451,455,460,463,480,483,487,496,499,504,508,511,768 %N A033015 Numbers whose base-2 expansion has no run of digits with length < 2. %C A033015 See A033016 and following for the variants in other bases, A043291 for run lengths equal to 2 (which has a very simple formula) and A033001 and following for the analog of the latter in other bases. - _M. F. Hasler_, Feb 01 2014 %C A033015 The number zero also satisfies the definition if we consider that its base-2 expansion is empty. - _M. F. Hasler_, Oct 06 2022 %C A033015 If we define row n as subset of terms with n bits, i.e., 2^(n-1) < a(k) < 2^n, then we get row n by duplicating the last bit (LSB) of the terms in row n-1 and appending twice the negated LSB to the terms in row n-2. This gives the FORMULA for the number of terms in row n. - _M. F. Hasler_, Oct 17 2022 %H A033015 Charles R Greathouse IV, <a href="/A033015/b033015.txt">Table of n, a(n) for n = 1..10000</a> %F A033015 The number of n-bit terms is Fibonacci(n-1) = A000045(n-1). - _M. F. Hasler_, Oct 17 2022 %e A033015 The first terms, written in binary, are: 11, 111, 1100, 1111, 11000, 11100, 11111, 110000, 110011, ...; cf. sequence A355280. - _M. F. Hasler_, Oct 06 2022 %t A033015 Select[Range[2000], Min[Length/@Split[IntegerDigits[#, 2]]]>1&] (* _Vincenzo Librandi_, Feb 05 2014 *) %o A033015 (PARI) is(n)=my(t); if(n%2, t=valuation(n+1,2); if(t==1,return(0)); n>>=t); while(n, t=valuation(n,2); if(t==1,return(0)); n>>=t; t=valuation(n+1,2); if(t==1,return(0)); n>>=t); 1 \\ _Charles R Greathouse IV_, Mar 29 2013 %o A033015 (PARI) select( is_A033015(n)=!bitand(n=bitxor(n,n<<1),n<<1)&&bitand(n,3)!=2, [1..770]) \\ _M. F. Hasler_, Oct 06 2022 (replacing less efficient code from 2014) %o A033015 (PARI) {A033015_row(n)=if(n>3, setunion([x*2+x%2|x<-A033015_row(n-1)], [x*4+3-x%2*3|x<-A033015_row(n-2)]), n>1, [2^n-1], [])} \\ "Row" of n-digit terms. For (very) large n one could use memoization rather than this naive recursive definition. %o A033015 concat(apply(A033015_row, [1..9])) \\ To get the "flattened" sequence. - _M. F. Hasler_, Oct 17 2022 %o A033015 (Python) %o A033015 from itertools import groupby %o A033015 def ok(n): return all(len(list(g)) >= 2 for k, g in groupby(bin(n)[2:])) %o A033015 print([i for i in range(1, 769) if ok(i)]) # _Michael S. Branicky_, Jan 04 2021 %o A033015 (Python) %o A033015 def A033015_row(n): # terms with n bits <=> in [2^(n-1) .. 2^n] %o A033015 return [[], [], [3], [7]][n] if n < 4 else sorted( %o A033015 [x*2+x%2 for x in A033015_row(n-1)] + %o A033015 [x*4+3-x%2*3 for x in A033015_row(n-2)]) # _M. F. Hasler_, Oct 17 2022 %o A033015 print(sum((A033015_row(n)for n in range(11)),[])) %Y A033015 Cf. A355280 (in binary). %Y A033015 Cf. A222813 (palindromes subsequence). %Y A033015 Cf. A033016, A043291. %Y A033015 See A033001 for further cross-references. %K A033015 nonn,base %O A033015 1,1 %A A033015 _Clark Kimberling_ %E A033015 Extended by _Ray Chandler_, Dec 18 2009