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!)
A091444 Concatenate binary vectors ordered first by length, then by the number of 1's and finally lexicographically. 5
0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,1
LINKS
MATHEMATICA
c[n_, k_] := If[k == 0, {0}, If[k == n, {2^n - 1}, Join[c[n - 1, k], c[n - 1, k - 1] + 2^(n - 1)]]];
b[n_] := If[n == 1, {0, 1}, Flatten[Table[c[n, k], {k, 0, n}]]];
a[n_] := Map[PadLeft, IntegerDigits[Array[b, n], 2]];
a[4] // Flatten (* Robert P. P. McKone, Aug 13 2021 *)
PROG
(Python)
from itertools import product
def sortby(x): return (len(x), x.count(1), x)
def agen(maxvecdigits):
for i in range(1, maxvecdigits+1):
for t in sorted([p for p in product([0, 1], repeat=i)], key=sortby):
yield from t
print([an for an in agen(4)]) # Michael S. Branicky, Aug 13 2021
CROSSREFS
Cf. A294648.
Sequence in context: A079101 A334941 A076478 * A091447 A356921 A356922
KEYWORD
easy,nonn
AUTHOR
Paul Boddington, Jan 10 2004
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 April 23 18:16 EDT 2024. Contains 371916 sequences. (Running on oeis4.)