login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A033015 Numbers whose base-2 expansion has no run of digits with length < 2. 23
3, 7, 12, 15, 24, 28, 31, 48, 51, 56, 60, 63, 96, 99, 103, 112, 115, 120, 124, 127, 192, 195, 199, 204, 207, 224, 227, 231, 240, 243, 248, 252, 255, 384, 387, 391, 396, 399, 408, 412, 415, 448, 451, 455, 460, 463, 480, 483, 487, 496, 499, 504, 508, 511, 768 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
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
The number zero also satisfies the definition if we consider that its base-2 expansion is empty. - M. F. Hasler, Oct 06 2022
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
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
FORMULA
The number of n-bit terms is Fibonacci(n-1) = A000045(n-1). - M. F. Hasler, Oct 17 2022
EXAMPLE
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
MATHEMATICA
Select[Range[2000], Min[Length/@Split[IntegerDigits[#, 2]]]>1&] (* Vincenzo Librandi, Feb 05 2014 *)
PROG
(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
(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)
(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.
concat(apply(A033015_row, [1..9])) \\ To get the "flattened" sequence. - M. F. Hasler, Oct 17 2022
(Python)
from itertools import groupby
def ok(n): return all(len(list(g)) >= 2 for k, g in groupby(bin(n)[2:]))
print([i for i in range(1, 769) if ok(i)]) # Michael S. Branicky, Jan 04 2021
(Python)
def A033015_row(n): # terms with n bits <=> in [2^(n-1) .. 2^n]
return [[], [], [3], [7]][n] if n < 4 else sorted(
[x*2+x%2 for x in A033015_row(n-1)] +
[x*4+3-x%2*3 for x in A033015_row(n-2)]) # M. F. Hasler, Oct 17 2022
print(sum((A033015_row(n)for n in range(11)), []))
CROSSREFS
Cf. A355280 (in binary).
Cf. A222813 (palindromes subsequence).
See A033001 for further cross-references.
Sequence in context: A310236 A296094 A075895 * A225574 A317305 A356425
KEYWORD
nonn,base
AUTHOR
EXTENSIONS
Extended by Ray Chandler, Dec 18 2009
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified February 29 16:55 EST 2024. Contains 370426 sequences. (Running on oeis4.)