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-4 of 4 results.

A210000 Number of unimodular 2 X 2 matrices having all terms in {0,1,...,n}.

Original entry on oeis.org

0, 6, 14, 30, 46, 78, 94, 142, 174, 222, 254, 334, 366, 462, 510, 574, 638, 766, 814, 958, 1022, 1118, 1198, 1374, 1438, 1598, 1694, 1838, 1934, 2158, 2222, 2462, 2590, 2750, 2878, 3070, 3166, 3454, 3598, 3790, 3918, 4238, 4334, 4670, 4830
Offset: 0

Views

Author

Clark Kimberling, Mar 16 2012

Keywords

Comments

a(n) is the number of 2 X 2 matrices having all terms in {0,1,...,n} and inverses with all terms integers.
Most sequences in the following guide count 2 X 2 matrices having all terms contained in the domain shown in column 2 and determinant d or permanent p or sum s of terms as indicated in column 3.
A059306 ... {0,1,...,n} ..... d=0
A171503 ... {0,1,...,n} ..... d=1
A210000 ... {0,1,...,n} .... |d|=1
A209973 ... {0,1,...,n} ..... d=2
A209975 ... {0,1,...,n} ..... d=3
A209976 ... {0,1,...,n} ..... d=4
A209977 ... {0,1,...,n} ..... d=5
A210282 ... {0,1,...,n} ..... d=n
A210283 ... {0,1,...,n} ..... d=n-1
A210284 ... {0,1,...,n} ..... d=n+1
A210285 ... {0,1,...,n} ..... d=floor(n/2)
A210286 ... {0,1,...,n} ..... d=trace
A280588 ... {0,1,...,n} ..... d=s
A106634 ... {0,1,...,n} ..... p=n
A210288 ... {0,1,...,n} ..... p=trace
A210289 ... {0,1,...,n} ..... p=(trace)^2
A280934 ... {0,1,...,n} ..... p=s
A210290 ... {0,1,...,n} ..... d>=0
A183761 ... {0,1,...,n} ..... d>0
A210291 ... {0,1,...,n} ..... d>n
A210366 ... {0,1,...,n} ..... d>=n
A210367 ... {0,1,...,n} ..... d>=2n
A210368 ... {0,1,...,n} ..... d>=3n
A210369 ... {0,1,...,n} ..... d is even
A210370 ... {0,1,...,n} ..... d is odd
A210371 ... {0,1,...,n} ..... d is even and >=0
A210372 ... {0,1,...,n} ..... d is even and >0
A210373 ... {0,1,...,n} ..... d is odd and >0
A210374 ... {0,1,...,n} ..... s=n+2
A210375 ... {0,1,...,n} ..... s=n+3
A210376 ... {0,1,...,n} ..... s=n+4
A210377 ... {0,1,...,n} ..... s=n+5
A210378 ... {0,1,...,n} ..... t is even
A210379 ... {0,1,...,n} ..... t is odd
A211031 ... {0,1,...,n} ..... d is in [-n,n]
A211032 ... {0,1,...,n} ..... d is in (-n,n)
A211033 ... {0,1,...,n} ..... d=0 (mod 3)
A211034 ... {0,1,...,n} ..... d=1 (mod 3)
A134506 ... {1,2,...,n} ..... d=0
A196227 ... {1,2,...,n} ..... d=1
A209979 ... {1,2,...,n} .... |d|=1
A197168 ... {1,2,...,n} ..... d=2
A210001 ... {1,2,...,n} ..... d=3
A210002 ... {1,2,...,n} ..... d=4
A210027 ... {1,2,...,n} ..... d=5
A211053 ... {1,2,...,n} ..... d=n
A211054 ... {1,2,...,n} ..... d=n-1
A211055 ... {1,2,...,n} ..... d=n+1
A055507 ... {1,2,...,n} ..... p=n
A211057 ... {1,2,...,n} ..... d is in [0,n]
A211058 ... {1,2,...,n} ..... d>=0
A211059 ... {1,2,...,n} ..... d>0
A211060 ... {1,2,...,n} ..... d>n
A211061 ... {1,2,...,n} ..... d>=n
A211062 ... {1,2,...,n} ..... d>=2n
A211063 ... {1,2,...,n} ..... d>=3n
A211064 ... {1,2,...,n} ..... d is even
A211065 ... {1,2,...,n} ..... d is odd
A211066 ... {1,2,...,n} ..... d is even and >=0
A211067 ... {1,2,...,n} ..... d is even and >0
A211068 ... {1,2,...,n} ..... d is odd and >0
A209981 ... {-n,....,n} ..... d=0
A209982 ... {-n,....,n} ..... d=1
A209984 ... {-n,....,n} ..... d=2
A209986 ... {-n,....,n} ..... d=3
A209988 ... {-n,....,n} ..... d=4
A209990 ... {-n,....,n} ..... d=5
A211140 ... {-n,....,n} ..... d=n
A211141 ... {-n,....,n} ..... d=n-1
A211142 ... {-n,....,n} ..... d=n+1
A211143 ... {-n,....,n} ..... d=n^2
A211140 ... {-n,....,n} ..... p=n
A211145 ... {-n,....,n} ..... p=trace
A211146 ... {-n,....,n} ..... d in [0,n]
A211147 ... {-n,....,n} ..... d>=0
A211148 ... {-n,....,n} ..... d>0
A211149 ... {-n,....,n} ..... d<0 or d>0
A211150 ... {-n,....,n} ..... d>n
A211151 ... {-n,....,n} ..... d>=n
A211152 ... {-n,....,n} ..... d>=2n
A211153 ... {-n,....,n} ..... d>=3n
A211154 ... {-n,....,n} ..... d is even
A211155 ... {-n,....,n} ..... d is odd
A211156 ... {-n,....,n} ..... d is even and >=0
A211157 ... {-n,....,n} ..... d is even and >0
A211158 ... {-n,....,n} ..... d is odd and >0

Examples

			a(2)=6 counts these matrices (using reduced matrix notation):
(1,0,0,1), determinant = 1, inverse = (1,0,0,1)
(1,0,1,1), determinant = 1, inverse = (1,0,-1,1)
(1,1,0,1), determinant = 1, inverse = (1,-1,0,1)
(0,1,1,0), determinant = -1, inverse = (0,1,1,0)
(0,1,1,1), determinant = -1, inverse = (-1,1,1,0)
(1,1,1,0), determinant = -1, inverse = (0,1,1,-1)
		

Crossrefs

Cf. A171503.
See also the very useful list of cross-references in the Comments section.

Programs

  • Mathematica
    a = 0; b = n; z1 = 50;
    t[n_] := t[n] = Flatten[Table[w*z - x*y, {w, a, b}, {x, a, b}, {y, a, b}, {z, a, b}]]
    c[n_, k_] := c[n, k] = Count[t[n], k]
    Table[c[n, 0], {n, 0, z1}]  (* A059306 *)
    Table[c[n, 1], {n, 0, z1}]  (* A171503 *)
    2 %                         (* A210000 *)
    Table[c[n, 2], {n, 0, z1}]  (* A209973 *)
    %/4                         (* A209974 *)
    Table[c[n, 3], {n, 0, z1}]  (* A209975 *)
    Table[c[n, 4], {n, 0, z1}]  (* A209976 *)
    Table[c[n, 5], {n, 0, z1}]  (* A209977 *)

Formula

a(n) = 2*A171503(n).

Extensions

A209982 added to list in comment by Chai Wah Wu, Nov 27 2016

A317614 a(n) = (1/2)*(n^3 + n*(n mod 2)).

Original entry on oeis.org

1, 4, 15, 32, 65, 108, 175, 256, 369, 500, 671, 864, 1105, 1372, 1695, 2048, 2465, 2916, 3439, 4000, 4641, 5324, 6095, 6912, 7825, 8788, 9855, 10976, 12209, 13500, 14911, 16384, 17985, 19652, 21455, 23328, 25345, 27436, 29679, 32000, 34481, 37044, 39775, 42592
Offset: 1

Views

Author

Stefano Spezia, Aug 01 2018

Keywords

Comments

Terms are obtained as partial sums in an algorithm for the generation of the sequence of the fourth powers (A000583). Starting with the sequence of the positive integers (A000027), it is necessary to delete every 4th term and to consider the partial sums of the obtained sequence, then to delete every 3rd term, and lastly to consider again the partial sums (see References).
a(n) is the trace of an n X n square matrix M(n) formed by writing the numbers 1, ..., n^2 successively forward and backward along the rows in zig-zag pattern as shown in the examples below. Specifically, M(n) is defined as M[i,j,n] = j + n*(i-1) if i is odd and M[i,j,n] = n*i - j + 1 if i is even, and it has det(M(n)) = 0 for n > 2 (proved).
From Saeed Barari, Oct 31 2021: (Start)
Also the sum of the entries in an n X n matrix whose elements start from 1 and increase as they approach the center. For instance, in case of n=5, the entries of the following matrix sum to 65:
1 2 3 2 1
2 3 4 3 2
3 4 5 4 3
2 3 4 3 2
1 2 3 2 1. (End)
The n X n square matrix of the preceding comment is defined as: A[i,j,n] = n - abs((n + 1)/2 - j) - abs((n + 1)/2 - i). - Stefano Spezia, Nov 05 2021

Examples

			For n = 1 the matrix M(1) is
  1
with trace Tr(M(1)) = a(1) = 1.
For n = 2 the matrix M(2) is
  1, 2
  4, 3
with Tr(M(2)) = a(2) = 4.
For n = 3 the matrix M(3) is
  1, 2, 3
  6, 5, 4
  7, 8, 9
with Tr(M(3)) = a(3) = 15.
		

References

  • Edward A. Ashcroft, Anthony A. Faustini, Rangaswami Jagannathan, and William W. Wadge, Multidimensional Programming, Oxford University Press 1995, p. 12.
  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See p. 64.
  • G. Polya, Mathematics and Plausible Reasoning: Induction and analogy in mathematics, Princeton University Press 1990, p. 118.
  • Shailesh Shirali, A Primer on Number Sequences, Universities Press (India) 2004, p. 106.
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, Exercise 3.7.3 on pages 122-123.

Crossrefs

Cf. A000583, A000027, A186424 (first differences).
Cf. related to the M matrices: A074147 (antidiagonals), A130130 (rank), A241016 (row sums), A317617 (column sums), A322277 (permanent), A323723 (subdiagonal sums), A323724 (superdiagonal sums).

Programs

  • GAP
    a_n:=List([1..nmax], n->(1/2)*(n^3 + n*RemInt(n, 2)));
    
  • GAP
    List([1..50],n->(1/2)*(n^3+n*(n mod 2))); # Muniru A Asiru, Aug 24 2018
  • Magma
    [IsEven(n) select n^3/2 else (n^3+n)/2: n in [1..50]]; // Vincenzo Librandi, Aug 07 2018
    
  • Maple
    a:=n->(1/2)*(n^3+n*modp(n,2)): seq(a(n),n=1..50); # Muniru A Asiru, Aug 24 2018
  • Mathematica
    CoefficientList[Series[1/4 E^-x (1 + 3 E^(2 x) + 6 E^(2 x) x + 2 E^(2 x) x^2), {x, 0, 45}], x]*Table[(k + 1)!, {k, 0, 45}]
    CoefficientList[Series[-(1 + x^2)/((-1 + x)*(1 + x)^3), {x, 0, 45}], x]*Table[(k + 1)*(-1)^k, {k, 0, 45}]
    CoefficientList[Series[-(1 + x^2)/((-1 + x)^3*(1 + x)), {x, 0, 45}], x]*Table[(k + 1), {k, 0, 45}]
    From Robert G. Wilson v, Aug 01 2018: (Start)
    a[i_, j_, n_] := If[OddQ@ i, j + n (i - 1), n*i - j + 1]; f[n_] := Tr[Table[a[i, j, n], {i, n}, {j, n}]]; Array[f, 45]
    CoefficientList[Series[(x^4 + 2x^3 + 6x^2 + 2x + 1)/((x - 1)^4 (x + 1)^2), {x, 0, 45}], x]
    LinearRecurrence[{2, 1, -4, 1, 2, -1}, {1, 4, 15, 32, 65, 108}, 45]
    (End)
  • Maxima
    a(n):=(1/2)*(n^3 + n*mod(n,2))$ makelist(a(n), n, 1, nmax);
    
  • PARI
    Vec(x*(1 + 2*x + 6*x^2 + 2*x^3 + x^4) / ((1 - x)^4*(1 + x)^2) + O(x^40)) \\ Colin Barker, Aug 02 2018
    
  • PARI
    M(i, j, n) = if (i % 2, j + n*(i-1), n*i - j + 1);
    a(n) = sum(k=1, n, M(k, k, n)); \\ Michel Marcus, Aug 07 2018
    
  • R
    for (n in 1:nmax){
       a <- (n^3+n*n%%2)/2
       output <- c(n, a)
       cat(output, "\n")
    }
    (MATLAB and FreeMat)
    for(n=1:nmax); a=(n^3+n*mod(n,2))/2; fprintf('%d\t%0.f\n',n,a); end
    

Formula

a(n) = (1/2)*(A000578(n) + n*A000035(n)).
a(n) = A006003(n) - (n/2)*(1 - (n mod 2)).
a(n) = Sum_{k=1..n} T(n,k), where T(n,k) = ((n + 1)*k - n)*(n mod 2) + ((n - 1)*k + 1)*(1 - (n mod 2)).
E.g.f.: E(x) = (1/4)*exp(-x)*x*(1 + 3*exp(2*x) + 6*exp(2*x)*x + 2*exp(2*x)*x^2).
L.g.f.: L(x) = -x*(1 + x^2)/((-1 + x)*(1 + x)^3).
H.l.g.f.: LH(x) = -x*(1 + x^2)/((-1 + x)^3*(1 + x)).
Dirichlet g.f.: (1/2)*(Zeta(-3 + s) + 2^(-s)*(-2 + 2^s)*Zeta(-1 + s)).
From Colin Barker, Aug 02 2018: (Start)
G.f.: x*(1 + 2*x + 6*x^2 + 2*x^3 + x^4) / ((1 - x)^4*(1 + x)^2).
a(n) = 2*a(n-1) + a(n-2) - 4*a(n-3) + a(n-4) + 2*a(n-5) - a(n-6) for n>6.
a(n) = n^3/2 for n even.
a(n) = (n^3+n)/2 for n odd. (End)
a(2*n) = A317297(n+1) + A001489(n). - Stefano Spezia, Dec 28 2018
Sum_{n>0} 1/a(n) = (1/2)*(-2*polygamma(0, 1/2) + polygamma(0, (1-i)/2)+ polygamma(0, (1+i)/2)) + zeta(3)/4 approximately equal to 1.3959168891658447368440622669882813003351669... - Stefano Spezia, Feb 11 2019
a(n) = (A000578(n) + A193356(n))/2. - Stefano Spezia, Jun 27 2022
a(n) = A210378(n-1)/n. - Stefano Spezia, Jul 15 2024

A210379 Number of 2 X 2 matrices with all terms in {0,1,...,n} and odd trace.

Original entry on oeis.org

0, 8, 36, 128, 300, 648, 1176, 2048, 3240, 5000, 7260, 10368, 14196, 19208, 25200, 32768, 41616, 52488, 64980, 80000, 97020, 117128, 139656, 165888, 195000, 228488, 265356, 307328, 353220, 405000, 461280, 524288, 592416, 668168
Offset: 0

Views

Author

Clark Kimberling, Mar 20 2012

Keywords

Examples

			Writing the matrices as 4-letter words, the 8 for n=1 are as follows:
1000, 1100, 1010, 1110, 0001, 0011, 0101, 0111
		

Crossrefs

See A210000 for a guide to related sequences.

Programs

  • Mathematica
    a = 0; b = n; z1 = 35;
    t[n_] := t[n] = Flatten[Table[w + z, {w, a, b}, {x, a, b}, {y, a, b}, {z, a, b}]]
    c[n_, k_] := c[n, k] = Count[t[n], k]
    u[n_] := Sum[c[n, 2 k], {k, 0, 2*n}]
    v[n_] := Sum[c[n, 2 k - 1], {k, 1, 2*n - 1}]
    Table[u[n], {n, 0, z1}] (* A210378 *)
    Table[v[n], {n, 0, z1}] (* A210379 *)

Formula

a(n) + A210378(n) = (n+1)^4.
From Chai Wah Wu, Nov 27 2016: (Start)
a(n) = (n + 1)^2*((n + 1)^2 - (2*n + 1 -(-1)^n)^2/16 - (2*n + 3 + (-1)^n)^2/16).
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.: -4*x*(2*x^4 + 5*x^3 + 10*x^2 + 5*x + 2)/((x - 1)^5*(x + 1)^3). (End)
From Amiram Eldar, Mar 15 2024: (Start)
a(n) = (n+1)^2*floor((n+1)^2/2).
Sum_{n>=1} 1/a(n) = Pi^4/720 + (10-Pi^2)/4. (End)

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
Showing 1-4 of 4 results.