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.

A276113 Number of 2 X 2 matrices with entries in {0,1,...,n} and permanent = (trace)^2 with no entry repeated.

Original entry on oeis.org

0, 0, 0, 0, 4, 4, 4, 8, 12, 24, 24, 24, 32, 52, 56, 56, 76, 76, 88, 120, 124, 152, 152, 152, 160, 192, 212, 236, 288, 288, 288, 352, 372, 372, 372, 376, 420, 496, 528, 600, 604, 604, 632, 724, 728, 740, 740, 740, 788, 932, 964
Offset: 0

Views

Author

Indranil Ghosh, Dec 11 2016

Keywords

Comments

All terms are multiples of 4 since the diagonals can be permuted. - Charles R Greathouse IV, Dec 12 2016

Crossrefs

Cf. A210289.

Programs

  • PARI
    a(n)=my(n2=n^2); 4*sum(a=0,n, sum(d=a+1,n, my(t=(a+d)^2-a*d,c); if(t>0 && tCharles R Greathouse IV, Dec 12 2016
  • Python
    def t(n):
        s=0
        for a in range(n+1):
            for b in range(n+1):
                for c in range(n+1):
                    for d in range(n+1):
                       if (a!=b  and a!=d and b!=d and c!=a and c!=b and c!=d):
                            if a*d+b*c==(a+d)**2:
                                s+=1
        return s
    for i in range(201):
        print(str(i)+" "+str(t(i)))