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.

A280056 Number of 2 X 2 matrices with entries in {0,1,...,n} and even trace with no entries repeated.

Original entry on oeis.org

0, 0, 0, 8, 48, 144, 360, 720, 1344, 2240, 3600, 5400, 7920, 11088, 15288, 20384, 26880, 34560, 44064, 55080, 68400, 83600, 101640, 121968, 145728, 172224, 202800, 236600, 275184, 317520, 365400, 417600, 476160, 539648, 610368, 686664, 771120, 861840, 961704, 1068560, 1185600
Offset: 0

Views

Author

Indranil Ghosh, Dec 24 2016

Keywords

Comments

a(n) mod 8 = 0.

Crossrefs

Cf. A210378 (where the elements can be repeated).

Programs

  • Mathematica
    Table[(1/4)*(n - 2)*(n - 1)*(2*n^2 - 1 + (-1)^n), {n, 0, 50}] (* G. C. Greubel, Dec 26 2016 *)
  • PARI
    concat(vector(3), Vec(8*x^3*(1 + 3*x)*(1 + x + x^2) / ((1 - x )^5*(1 + x)^3) + O(x^30))) \\ Colin Barker, Dec 25 2016
  • Python
    def a(n):
        s=0
        for a in range(0,n+1):
            for b in range(0,n+1):
                if a!=b:
                    for c in range(0,n+1):
                        if a!=c and b!=c:
                            for d in range(0,n+1):
                                if d!=a and d!=b and d!=c:
                                    if (a+d)%2==0:
                                        s+=1
        return s
    for i in range(0,41):
        print(i, a(i))
    
  • Python
    def A280056(n):
        return (n**2 - (n % 2))*(n-1)*(n-2)//2 # Chai Wah Wu, Dec 25 2016
    

Formula

a(n) = ((-1)^n + 2*n^2 - 1)*(n-1)*(n-2)/4.
From Colin Barker, Dec 25 2016: (Start)
a(n) = (n^4 - 3*n^3 + 2*n^2)/2 for n even.
a(n) = (n^4 - 3*n^3 + n^2 + 3*n - 2)/2 for n odd.
a(n) = 2*a(n-1) + 2*a(n-2) - 6*a(n-3) + 6*a(n-5) - 2*a(n-6) - 2*a(n-7) + a(n-8) for n>7.
G.f.: 8*x^3*(1 + 3*x)*(1 + x + x^2) / ((1 - x )^5*(1 + x)^3). (End)
These formulas are true. a(n) = ((-1)^n + 2*n^2 - 1)*(n-1)*(n-2)/4 = (n^2 - p(n))*C(n-1,2), where p(n) is the parity of n, i.e., p(n) = 0 if n is even and p(n) = 1 if n is odd. - Chai Wah Wu, Dec 25 2016
E.g.f.: (1/4)*((2 + 2*x + x^2)*exp(-x) + (-2 + 2*x - x^2 + 6*x^3 + 2*x^4)*exp(x)). - David Radcliffe, Aug 16 2025

Extensions

Formulas corrected by David Radcliffe, Aug 16 2025