cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-2 of 2 results.

A289971 Number of permutations of [n] determined by their antidiagonal sums.

Original entry on oeis.org

1, 1, 2, 4, 9, 20, 49, 114, 277, 665, 1608, 3875
Offset: 0

Views

Author

Martin Rubey, Jul 16 2017

Keywords

Crossrefs

Programs

  • Mathematica
    xray[perm_List] := Module[{P, n = Length[perm]}, P[, ] = 0; Thread[perm -> Range[n]] /. Rule[i_, j_] :> Set[P[i, j], 1]; Table[Sum[P[i - j + 1, j], {j, Max[1, i - n + 1], Min[i, n]}], {i, 1, 2n - 1}]];
    a[n_] := xray /@ Permutations[Range[n]] // Tally // Count[#, {_List, 1}]&;
    Do[Print[n, " ", a[n]], {n, 0, 10}] (* Jean-François Alcover, Feb 28 2020 *)
  • Sage
    def X_ray(pi):
        P = Permutation(pi).to_matrix()
        n = P.nrows()
        return tuple(sum(P[k-1-j][j] for j in range(max(0, k-n), min(k,n)))
                     for k in range(1,2*n))
    @cached_function
    def X_rays(n):
        return sorted(X_ray(pi) for pi in Permutations(n))
    def statistic(pi): return X_rays(pi.size()).count(X_ray(pi))
    [[statistic(pi) for pi in Permutations(n)].count(1) for n in range(7)]

Extensions

a(8)-a(11) from Alois P. Heinz, Jul 24 2017

A290280 Number of pairs of orthogonal (diagonal, antidiagonal) X-rays for all permutations of [n].

Original entry on oeis.org

1, 1, 2, 6, 23, 115, 674, 4718, 37371, 335435, 3340116
Offset: 0

Views

Author

Alois P. Heinz, Jul 25 2017

Keywords

Comments

The X-rays of a permutation are sequences of (diagonal, antidiagonal) sums of the corresponding permutation matrix.
A unique pair of orthogonal (diagonal, antidiagonal) X-rays allows identification of the permutation.

Examples

			a(4) = 23.  All permutations of {1,2,3,4} have unique pairs of orthogonal X-rays except 2413 and 3142, which share the same pair (0110110, 0110110):
.
.  0110110       .  0110110
.   \\\+--\-+    .   \\\+--\-+
.  2 \\| 1  |    .  3 \\|  1 |
.  4  \|   1|    .  1  \|1   |
.  1  /|1   |    .  4  /|   1|
.  3 //|  1 |    .  2 //| 1  |
.   ///+--/-+    .   ///+--/-+
.  0110110       .  0110110
		

Crossrefs

Showing 1-2 of 2 results.