login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A165191
Irregular triangle B(n,i) = i-th significant bit of Gray code of n.
0
0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1
OFFSET
0
COMMENTS
The n-th row has length A070939(n); a nondecreasing sequence.
Each row, when interpreted as a finite sequence can be mapped via Euler's Transform to familiar integer sequences.
Note that adjacent rows differ by only one "bit" which simplifies the transition from one row to the next. (cf. A003188, A055975 and A119972).
FORMULA
The n-th row is the reversed bit string of A003188(n). Namely, A003188(n) = Sum_{0<=i<A070939(n)} B(n,i) 2^i.
EXAMPLE
The triangle begins: 0 1 11 01 011 111 101 001 0011 1011 1111 0111 0101 1101 1001 0001 00011 10011 11011 11111 ...
MAPLE
B:= proc(n) option remember; local b; b:= ilog2(n);
`if`(n<=1, n, zip((x, y)->x+y, [B(2^(b+1)-1-n)], [0$b, 1], 0)[])
end:
seq(B(n), n=0..30); # Alois P. Heinz, May 21 2012
MATHEMATICA
zip = With[{m = Max[Length[#1], Length[#2]]}, PadRight[#1, m] + PadRight[#2, m]]&; B[n_] := B[n] = With[{b = Floor[Log[2, n]]}, If[n <= 1, {n}, zip[B[2^(b+1)-1-n], Append[Array[0&, b], 1]]]]; Table[B[n], {n, 0, 30}] // Flatten (* Jean-François Alcover, Feb 13 2017, after Alois P. Heinz *)
PROG
(Magma) // Recursive
N := 5; s := [[]];
for n in [1..N] do
for j in [#s..1 by -1] do
Append(~s, Append(s[j], 1));
Append(~s[j], 0);
end for;
end for;
&cat[IntegerToSequence(SequenceToInteger(b, 2), 2):b in s];
(Magma) // Direct
B:=func<n|[(s[i]+s[i+1])mod 2:i in[1..#s-1]]cat[s[#s]]where s is IntegerToSequence(n, 2)>;
CROSSREFS
Euler transforms of the rows begin: A000007, A000012, A008619, A059841, A103221, A001399, A008620, A022003, A008679, A025767, A001400.
Sequence in context: A378901 A278718 A130854 * A189576 A112448 A101264
KEYWORD
nonn,easy,tabf
AUTHOR
Alford Arnold, Sep 29 2009
EXTENSIONS
Edited by Jason Kimberley, Mar 31 2012
STATUS
approved