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.

This page as a plain text file.
%I A280056 #37 Aug 17 2025 03:05:51
%S A280056 0,0,0,8,48,144,360,720,1344,2240,3600,5400,7920,11088,15288,20384,
%T A280056 26880,34560,44064,55080,68400,83600,101640,121968,145728,172224,
%U A280056 202800,236600,275184,317520,365400,417600,476160,539648,610368,686664,771120,861840,961704,1068560,1185600
%N A280056 Number of 2 X 2 matrices with entries in {0,1,...,n} and even trace with no entries repeated.
%C A280056 a(n) mod 8 = 0.
%H A280056 Indranil Ghosh, <a href="/A280056/b280056.txt">Table of n, a(n) for n = 0..1000</a>
%H A280056 <a href="/index/Rec#order_08">Index entries for linear recurrences with constant coefficients</a>, signature (2,2,-6,0,6,-2,-2,1).
%F A280056 a(n) = ((-1)^n + 2*n^2 - 1)*(n-1)*(n-2)/4.
%F A280056 From _Colin Barker_, Dec 25 2016: (Start)
%F A280056 a(n) = (n^4 - 3*n^3 + 2*n^2)/2 for n even.
%F A280056 a(n) = (n^4 - 3*n^3 + n^2 + 3*n - 2)/2 for n odd.
%F A280056 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.
%F A280056 G.f.: 8*x^3*(1 + 3*x)*(1 + x + x^2) / ((1 - x )^5*(1 + x)^3). (End)
%F A280056 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
%F A280056 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
%t A280056 Table[(1/4)*(n - 2)*(n - 1)*(2*n^2 - 1 + (-1)^n), {n, 0, 50}] (* _G. C. Greubel_, Dec 26 2016 *)
%o A280056 (Python)
%o A280056 def a(n):
%o A280056     s=0
%o A280056     for a in range(0,n+1):
%o A280056         for b in range(0,n+1):
%o A280056             if a!=b:
%o A280056                 for c in range(0,n+1):
%o A280056                     if a!=c and b!=c:
%o A280056                         for d in range(0,n+1):
%o A280056                             if d!=a and d!=b and d!=c:
%o A280056                                 if (a+d)%2==0:
%o A280056                                     s+=1
%o A280056     return s
%o A280056 for i in range(0,41):
%o A280056     print(i, a(i))
%o A280056 (Python)
%o A280056 def A280056(n):
%o A280056     return (n**2 - (n % 2))*(n-1)*(n-2)//2 # _Chai Wah Wu_, Dec 25 2016
%o A280056 (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
%Y A280056 Cf. A210378 (where the elements can be repeated).
%K A280056 nonn,easy
%O A280056 0,4
%A A280056 _Indranil Ghosh_, Dec 24 2016
%E A280056 Formulas corrected by _David Radcliffe_, Aug 16 2025