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”).

A375301
Triangle T(n,k) read by rows with row n equal to the unique permutation pi_n of [1, ..., n] such that k + pi_n(k) is a power of 2 for 1 <= k <= n.
1
1, 1, 2, 3, 2, 1, 3, 2, 1, 4, 1, 2, 5, 4, 3, 1, 6, 5, 4, 3, 2, 7, 6, 5, 4, 3, 2, 1, 7, 6, 5, 4, 3, 2, 1, 8, 1, 6, 5, 4, 3, 2, 9, 8, 7, 1, 2, 5, 4, 3, 10, 9, 8, 7, 6, 3, 2, 1, 4, 11, 10, 9, 8, 7, 6, 5, 3, 2, 1, 12, 11, 10, 9, 8, 7, 6, 5, 4, 1, 2, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3
OFFSET
1,3
LINKS
Zhi-Wei Sun, On permutations of {1, ..., n} and related topics, J Algebr Comb 54, 893-912 (2021); Theorem 1.2, page 895.
EXAMPLE
The triangle begins
1,
1, 2,
3, 2, 1,
3, 2, 1, 4,
1, 2, 5, 4, 3,
1, 6, 5, 4, 3, 2,
7, 6, 5, 4, 3, 2, 1,
7, 6, 5, 4, 3, 2, 1, 8,
...
Row 5: [1, 2, 5, 4, 3] + [1, 2, 3, 4, 5] = [2, 4, 8, 8, 8]; only powers of 2 in the vector of sums.
PROG
(PARI) a375301_row(n) = forperm(n, p, my(f=1); for(k=1, n, my(s=p[k]+k); if(2^valuation(s, 2)!=s, f=0; break)); if(f==1, return(Vec(p))))
CROSSREFS
A375302 gives the rank of row n in lexicographically ordered permutations of [n].
Cf. A000079.
Sequence in context: A204933 A240224 A118105 * A125211 A139367 A117648
KEYWORD
nonn,tabl
AUTHOR
Hugo Pfoertner, Aug 25 2024
STATUS
approved