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, 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
Examples
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.
Links
- Zhi-Wei Sun, On permutations of {1, ..., n} and related topics, J Algebr Comb 54, 893-912 (2021); Theorem 1.2, page 895.
Crossrefs
Programs
-
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))))