OFFSET
1,3
COMMENTS
n-th row = (r(1),r(2),...,r(m)), where m=2^(n-1), satisfies r(r(k))=k for k=1,2,...,m and has exactly 2^[ n/2 ] solutions of r(k)=k. (The function r(k) reverses bits. Or rather, r(k)=revbits(k-1)+1.)
In a knockout competition with m players, arranging the competition brackets (see links) in r(k) order, where k is the rank of the player, ensures that highest ranked players cannot meet until the later stages of the competition. None of the top 2^p ranked players can meet earlier than the p-th from last round of the competition. At the same time the top ranked players in each match meet the highest ranked player possible consistent with this rule. The sequence for the top ranked players meeting the lowest ranked player possible is A131271. - Colin Hall, Jul 31 2011, Feb 29 2012
Row n contains one of A003407(2^(n-1)) non-averaging permutations of [2^(n-1)], i.e., a permutation of [2^(n-1)] without 3-term arithmetic progressions. - Alois P. Heinz, Dec 05 2017
LINKS
Alois P. Heinz, Rows n = 1..13, flattened
Eric Weisstein's World of Mathematics, Nonaveraging Sequence.
Wikipedia, Arithmetic progression.
Wikipedia, Bracket (tournament).
EXAMPLE
Triangle begins:
1;
1, 2;
1, 3, 2, 4;
1, 5, 3, 7, 2, 6, 4, 8;
1, 9, 5, 13, 3, 11, 7, 15, 2, 10, 6, 14, 4, 12, 8, 16;
1, 17, 9, 25, 5, 21, 13, 29, 3, 19, 11, 27, 7, 23, 15, 31, 2, 18, 10, 26, ...
MAPLE
T:= proc(n) option remember; `if`(n=1, 1,
[map(x->2*x-1, [T(n-1)])[], map(x->2*x, [T(n-1)])[]][])
end:
seq(T(n), n=1..7); # Alois P. Heinz, Oct 28 2011
MATHEMATICA
row[1] = {1}; row[n_] := row[n] = Join[ 2*row[n-1] - 1, 2*row[n-1] ]; Flatten[ Table[ row[n], {n, 1, 7}]] (* Jean-François Alcover, May 03 2012 *)
PROG
(PARI) (a(n, k) = if( k<=0 || k>=n, 0, if( k%2, n\2) + a(n\2, k\2))); {T(n, k) = if( k<=0 || k>2^n/2, 0, 1 + a(2^n/2, k-1))}; /* Michael Somos, Oct 13 1999 */
(Haskell)
a049773 n k = a049773_tabf !! (n-1) !! (k-1)
a049773_row n = a049773_tabf !! (n-1)
a049773_tabf = iterate f [1] where
f vs = (map (subtract 1) ws) ++ ws where ws = map (* 2) vs
-- Reinhard Zumkeller, Mar 14 2015
KEYWORD
AUTHOR
STATUS
approved