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.

Previous Showing 11-15 of 15 results.

A133922 a(n) is number of permutations (p(1),p(2),p(3),...,p(n)) of (1,2,3,...,n) such that p(k) is coprime to p(n+1-k) for k = all positive integers <= n.

Original entry on oeis.org

1, 2, 2, 16, 16, 192, 192, 6912, 4608, 230400, 230400, 11612160, 11612160, 1199923200, 588349440, 98594979840, 98594979840, 11076328488960, 11076328488960, 2102897147904000, 1076597725593600, 331238941183180800, 331238941183180800, 66325953940291584000, 56326771107377971200
Offset: 1

Views

Author

Leroy Quet, Jan 07 2008

Keywords

Comments

For n = odd integer the middle term of all counted permutations must be 1.
From Robert Israel, Sep 12 2016: (Start)
Consider the graph with vertices [1,...,n] if n is even, [2,...,n] if n is odd, and edges joining coprime integers.
a(n) is A037223(n) times the number of perfect matchings in this graph.
If n is even, a(n) = A037223(n)*A009679(n/2).
If n is an odd prime, a(n) = a(n-1). (End)

Examples

			For n = 6, the permutation (3,2,1,6,4,5) is not counted because p(2)=2 is not coprime to p(5)=4. However, the permutation (3,6,1,4,5,2) is counted because GCD(3,2) = GCD(6,5) = GCD(1,4) = 1.
		

Crossrefs

Programs

  • Maple
    M:= proc(A) option remember;
        local n,t,i,Ai,Ap,inds,isrt,As;
        n:= nops(A);
        if n = 0 then return 1 fi;
        t:= 0;
        for i in A[1] do
          inds:= [$2..i-1,$i+1..n];
          Ai:= subs([1=NULL,i=NULL,seq(inds[i]=i,i=1..n-2)],A[inds]);
          isrt:= sort([$1..n-2],(r,s) -> nops(Ai(r)) <= nops(Ai(s)),output=permutation);
          Ai:= subs([seq(isrt[i]=i,i=1..n-2)],Ai[isrt]);
          t:= t + procname(Ai);
        od;
        t;
    end proc:
    F:= proc(n) local A;
      if n::odd then
        if isprime(n) then return procname(n-1) fi;
        A:= [seq(select(t -> igcd(t+1,i+1)=1, [$1..i-1,$i+1..n-1]),i=1..n-1)];
      else
        A:= [seq(select(t -> igcd(t,i)=1,[$1..i-1,$i+1..n]),i=1..n)]
      fi;
      M(A)*floor(n/2)!*2^floor(n/2)
    end proc;
    seq(F(n),n=1..27); # Robert Israel, Sep 12 2016

Extensions

a(6)-a(15) from Sean A. Irvine, May 17 2010
a(16)-a(25) from Robert Israel, Sep 12 2016

A260189 a(n) = A033148(n) / 2^floor(n/4).

Original entry on oeis.org

1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 4, 8, 0, 0, 15, 22, 0, 0, 52, 51, 0, 0, 257, 342, 0, 0, 1589, 2609, 0, 0, 11417, 16896, 0, 0, 75375, 99114, 0, 0, 616010, 876579, 0, 0, 5253278, 8551800, 0, 0, 49667373, 79595269, 0, 0, 525731268, 764804085, 0, 0, 5932910966, 8905825760, 0, 0
Offset: 1

Views

Author

Vaclav Kotesovec, following a suggestion of Don Knuth, Jul 18 2015

Keywords

References

  • W. Ahrens, Mathematische Unterhaltungen und Spiele, 2nd edition, volume 1, Teubner, 1910, pages 249-258.
  • Maurice Kraitchik, Le probleme des reines, Bruxelles: L'Échiquier, 1926, 18.

Crossrefs

A277083 Irregular triangle read by rows: T(n,k) = number of size k subsets of S_n that remain unchanged by a rotation of 180 degrees.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 1, 2, 3, 4, 3, 2, 1, 1, 8, 36, 120, 322, 728, 1428, 2472, 3823, 5328, 6728, 7728, 8092, 7728, 6728, 5328, 3823, 2472, 1428, 728, 322, 120, 36, 8, 1, 1, 8, 84, 504, 3178, 15512, 74788, 311144, 1252819, 4577328, 16087512, 52691408, 165911284
Offset: 0

Views

Author

Christian Bean, Sep 28 2016

Keywords

Comments

A permutation, p, can be thought of as a set of points (i, p(i)). If you plot all the points and rotate the picture by 180 degrees then you get a permutation back.
T(n,k) is the number of size k subsets of S_n that remain unchanged by a rotation of 180 degrees.

Examples

			For n = 3 and k = 3, the subsets unchanged by rotating 180 degrees are {213,132,123}, {231,312,123}, {321,132,213} and {321,231,312} so T(3,3) = 4.
Triangle starts:
1, 1;
1, 1;
1, 2, 1;
1, 2, 3, 4, 3, 2, 1;
		

Crossrefs

Row lengths give A038507.
Cf. A037223.

Formula

T(n,k) = Sum_( binomial( n! - R(n), i ) * binomial( R(n), k-2*i ) for i in [0..floor(k/2)] ) where R(n) = A037223(n).

A277085 Irregular triangle read by rows: T(n,k) = number of size k subsets of S_n that remain unchanged by a rotation of 90 degrees.

Original entry on oeis.org

1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 2, 4, 6, 10, 14, 20, 26, 31, 36, 40, 44, 44, 44, 40, 36, 31, 26, 20, 14, 10, 6, 4, 2, 1, 1, 2, 4, 6, 34, 62, 116, 170, 547, 924, 1624, 2324, 5572, 8820, 14616, 20412, 40509, 60606, 95004, 129402, 224406, 319410
Offset: 0

Views

Author

Christian Bean, Sep 28 2016

Keywords

Comments

A permutation, p, can be thought of as a set of points (i, p(i)). If you plot all the points and rotate the picture by 90 degrees then you get a permutation back.
T(n,k) is the number of size k subsets that remain unchanged by a rotation of 90 degrees.

Examples

			For n = 4 and k = 2, the subsets unchanged by a 90-degree rotation are {4321,1234}, {4231,1324}, {3412,2143} and {3142,2413}. Hence T(4,2) = 4.
Triangle starts:
1, 1;
1, 1;
1, 0, 1;
1, 0, 1, 0, 1, 0, 1;
		

Crossrefs

Row lengths give A038507.

Formula

T(n,k) = Sum_( C( R(n) - T(n), i ) * Sum_(C(n! - R(n), j) * C(T(n), k - 4*i - 2*j) for j in [0..floor((k-4*i)/2)] for i in [0..floor(k/4)] ) where R(n) = A037223(n) and T(n) = A037224(n).

A383370 Number of partial orders on {1,2,...,n} that are contained in the usual linear order, whose dual is given by the relabelling k -> n+1-k.

Original entry on oeis.org

1, 1, 2, 3, 12, 25, 172, 482, 5318, 19675, 333768, 1609846, 40832554, 254370640, 9459449890, 75546875426, 4061670272088
Offset: 0

Views

Author

Ludovic Schwob, Apr 24 2025

Keywords

Comments

a(n) is the number of n X n upper triangular Boolean matrices B with all diagonal entries 1 such that B = B^2, which are symmetric about the antidiagonal. These matrices can be seen as closed sets of inversions (pairs (i,j) with 1 <= i < j <= n). A set of inversions E is closed if for all i < j < k, if E contains (i,j) and (j,k) then it contains (i,k).

Examples

			The Boolean matrices corresponding to a(4) = 12:
  1 0 0 0    1 0 0 1    1 0 0 0    1 0 0 1
  0 1 0 0    0 1 0 0    0 1 1 0    0 1 1 0
  0 0 1 0    0 0 1 0    0 0 1 0    0 0 1 0
  0 0 0 1    0 0 0 1    0 0 0 1    0 0 0 1
.
  1 0 1 0    1 0 1 1    1 0 1 0    1 0 1 1
  0 1 0 1    0 1 0 1    0 1 1 1    0 1 1 1
  0 0 1 0    0 0 1 0    0 0 1 0    0 0 1 0
  0 0 0 1    0 0 0 1    0 0 0 1    0 0 0 1
.
  1 1 0 0    1 1 0 1    1 1 1 1    1 1 1 1
  0 1 0 0    0 1 0 0    0 1 0 1    0 1 1 1
  0 0 1 1    0 0 1 1    0 0 1 1    0 0 1 1
  0 0 0 1    0 0 0 1    0 0 0 1    0 0 0 1
		

Crossrefs

Programs

  • SageMath
    def a(n):
        S = set()
        for P in Posets(n):
            if P.is_isomorphic(P.dual()):
                for l in P.linear_extensions():
                    t = tuple(tuple(int(P.is_lequal(l[j],l[i])) for j in range(i)) for i in range(1,len(l)))
                    if all(t[j][i]==t[n-i-2][n-j-2] for i in range((n-1)//2) for j in range(i,n-i-2)):
                        S.add(t)
        return len(S)

Extensions

a(10)-a(16) from Christian Sievers, May 02 2025
Previous Showing 11-15 of 15 results.