A290258 Triangle read by rows: row n (>=2) contains in increasing order the integers for which the binary representation has length n and all runs of 1's have even length.
3, 6, 12, 15, 24, 27, 30, 48, 51, 54, 60, 63, 96, 99, 102, 108, 111, 120, 123, 126, 192, 195, 198, 204, 207, 216, 219, 222, 240, 243, 246, 252, 255, 384, 387, 390, 396, 399, 408, 411, 414, 432, 435, 438, 444, 447, 480, 483, 486, 492, 495, 504, 507, 510
Offset: 2
Examples
399 is in the sequence because all the runs of 1's of its binary representation, namely 110001111, have even lengths. Triangle begins: 3; 6; 12,15; 24,27,30; 48,51,54,60,63; 96,99,102,108,111,120,123,126; ...
Programs
-
Maple
A[2] := {3}; A[3] := {6}; for n from 4 to 10 do A[n] := `union`(map(proc (x) 2*x end proc, A[n-1]), map(proc (x) 4*x+3 end proc, A[n-2])) end do; # yields sequence in triangular form
-
Mathematica
A[2] = {3}; A[3] = {6}; For[n = 4, n <= 10, n++, A[n] = Union[2 A[n-1], 4 A[n-2] + 3]]; Table[A[n], {n, 2, 10}] // Flatten (* Jean-François Alcover, Aug 19 2024, after Maple program *)
Formula
The entries in row n (n>=4) are: (i) 2x, where x is in row n-1 and (ii) 4y + 3, where y is in row n-2. The Maple program is based on this.
Comments