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-10 of 73 results. Next

A204017 Array: row n shows the coefficients of the characteristic polynomial of the n-th principal submatrix of max{j mod i, i mod j} (A204016).

Original entry on oeis.org

0, -1, -1, 0, 1, 4, 6, 0, -1, -15, -38, -20, 0, 1, 56, 206, 184, 50, 0, -1, -185, -1072, -1357, -630, -105, 0, 1, 204, 5146, 9276, 6060, 1736, 196, 0, -1, 6209, -17334, -58470, -52452, -21102, -4116, -336, 0, 1, -112400, -67682, 293984
Offset: 1

Views

Author

Clark Kimberling, Jan 10 2012

Keywords

Comments

Let p(n)=p(n,x) be the characteristic polynomial of the n-th principal submatrix. The zeros of p(n) are real, and they interlace the zeros of p(n+1). See A204016 and A202605 for guides to related sequences.

Examples

			Top of the array:
 1... -1
-1.... 0.... 1
 4.... 6.... 0... -1
-15.. -38.. -20... 0... 1
 56... 206.. 184.. 50.. 0.. -1
...
The 1st principal submatrix (ps) of A204016 is {{1}} (using Mathematica matrix notation), with p(1)=1-x and zero-set {1}.
...
The 2nd ps is {{0,1},{1,0}}, with p(2)=-1+x^2 and zero-set {-1,1}.
...
The 3rd ps is {{0,1,1},{1,0,2},{1,2,0}}, with p(3)=4+6x-x^3 and zero-set {-2, -0.732...,2.732...}.
...
The 4th ps is {{0,1,1,1},{1,0,2,2},{1,2,0,3},{1,2,0,3}}, with p(4)=-15-38x-20x^2+x^4 and zero-set {-3, -1.714, -0.553, 5.268}.
...
The interlace property is illustrated for the last two zero-sets by this chain:
-3 < -2 < -1.7 < -0.7 < -0.5 < 2.7 < 5.2
		

References

  • (For references regarding interlacing roots, see A202605.)

Crossrefs

Programs

  • Mathematica
    f[i_, j_] := Max[Mod[i, j], Mod[j, i]];
    m[n_] := Table[f[i, j], {i, 1, n}, {j, 1, n}]
    TableForm[m[8]] (* 8x8 principal submatrix *)
    Flatten[Table[f[i, n + 1 - i],
    {n, 1, 12}, {i, 1, n}]]  (* A204016 *)
    p[n_] := CharacteristicPolynomial[m[n], x];
    c[n_] := CoefficientList[p[n], x]
    TableForm[Flatten[Table[p[n], {n, 1, 10}]]]
    Table[c[n], {n, 1, 12}]
    Flatten[%]               (* A204017 *)
    TableForm[Table[c[n], {n, 1, 10}]]

A204233 Permanent of the n-th principal submatrix of A204016.

Original entry on oeis.org

0, 1, 4, 49, 792, 18953, 610796, 25648641, 1359184384, 88722005809, 6994262098260, 655126226755025, 71915748374032232, 9144536677714434105, 1333394182537641307324, 221002933797466121742433
Offset: 1

Views

Author

Clark Kimberling, Jan 13 2012

Keywords

Crossrefs

Cf. A204016.

Programs

  • Mathematica
    f[i_, j_] := Max[Mod[i, j], Mod[j, i]];
    m[n_] := Table[f[i, j],
    {i, 1, n}, {j, 1, n}]  (* A204016 *)
    Permanent[m_] :=
      With[{a = Array[x, Length[m]]},
       Coefficient[Times @@ (m.a), Times @@ a]];
    Table[Permanent[m[n]], {n, 1, 16}]  (* A204233 *)

A204164 Symmetric matrix based on f(i,j) = floor((i+j)/2), by antidiagonals.

Original entry on oeis.org

1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
Offset: 1

Views

Author

Clark Kimberling, Jan 12 2012

Keywords

Comments

A204164 represents the matrix M given by f(i,j) = floor((i+j)/2) for i >= 1 and j >= 1. See A204165 for characteristic polynomials of principal submatrices of M, with interlacing zeros. See A204016 for a guide to other choices of M.
k appears 4k-1 times, k > 0. - Boris Putievskiy, Jun 12 2024
Number of numbers of the form 2k^2+k+1 <= n, for k = 0,1,2,... - Wesley Ivan Hurt, Jun 19 2024

Examples

			Northwest corner:
  1 1 2 2 3 3 4 4
  1 2 2 3 3 4 4 5
  2 2 3 3 4 4 5 5
  2 3 3 4 4 5 5 6
  3 3 4 4 5 5 6 6
		

Crossrefs

Programs

  • Mathematica
    f[i_, j_] := Floor[(i + j)/2];
    m[n_] := Table[f[i, j], {i, 1, n}, {j, 1, n}]
    TableForm[m[8]] (* 8 X 8 principal submatrix *)
    Flatten[Table[f[i, n + 1 - i], {n, 1, 15}, {i, 1, n}]]  (* this sequence *)
      (* or *)
    p[n_] := CharacteristicPolynomial[m[n], x];
    c[n_] := CoefficientList[p[n], x]
    TableForm[Flatten[Table[p[n], {n, 1, 10}]]]
    Table[c[n], {n, 1, 12}]
    Flatten[%]                 (* A204165 *)
    TableForm[Table[c[n], {n, 1, 10}]]
      (* or *)
    a[n_] = Ceiling[(Sqrt[8*n + 1] - 1)/4];
    Nmax = 21; Table[a[n], {n, 1, Nmax}] (* Boris Putievskiy, Jun 12 2024 *)
  • Python
    from math import isqrt
    def A204164(n): return (m:=isqrt(n>>1))+(n>m*((m<<1)+1)) # Chai Wah Wu, Nov 14 2024

Formula

a(n) = ceiling((sqrt(8*n+1)-1)/4). - Boris Putievskiy, Jun 12 2024
a(n) = Sum_{k=1..n} [c(k) = c(k-1)+1], where c(n) = floor(sqrt(2n)+1/2) mod 2 = A057211(n) and [] is the Iverson bracket. - Wesley Ivan Hurt, Jun 23 2024
a(n) = m+1 if n>m(2m+1) and a(n) = m otherwise where m = floor(sqrt(n/2)). - Chai Wah Wu, Nov 14 2024

A204154 Symmetric matrix based on f(i,j) = max(2i-j, 2j-i), by antidiagonals.

Original entry on oeis.org

1, 3, 3, 5, 2, 5, 7, 4, 4, 7, 9, 6, 3, 6, 9, 11, 8, 5, 5, 8, 11, 13, 10, 7, 4, 7, 10, 13, 15, 12, 9, 6, 6, 9, 12, 15, 17, 14, 11, 8, 5, 8, 11, 14, 17, 19, 16, 13, 10, 7, 7, 10, 13, 16, 19, 21, 18, 15, 12, 9, 6, 9, 12, 15, 18, 21, 23, 20, 17, 14, 11, 8, 8, 11, 14, 17, 20
Offset: 1

Views

Author

Clark Kimberling, Jan 12 2012

Keywords

Comments

A204154 represents the matrix M given by f(i,j) = max(2i-j, 2j-i) for i >= 1 and j >= 1. See A204155 for characteristic polynomials of principal submatrices of M, with interlacing zeros. See A204016 for a guide to other choices of M.
From Nathaniel J. Strout, Nov 14 2019: (Start)
The sum of the terms in the n-th "_|" shape is given by the octagonal numbers, A000567. For example,
5,
4,
5,4,3,
is considered the 3rd such shape.
The sum of the terms in the n-th antidiagonal is the absolute value of the (n+1)-th term of A266085. (End)

Examples

			Northwest corner:
  1, 3, 5, 7, 9, ...
  3, 2, 4, 6, 8, ...
  5, 4, 3, 5, 7, ...
  7, 6, 5, 4, 6, ...
  9, 8, 7, 6, 5, ...
  ...
		

Crossrefs

Programs

  • Maple
    seq(seq(max(3*j-m,2*m-3*j),j=1..m-1),m=2..19); # Robert Israel, Dec 03 2017
  • Mathematica
    f[i_, j_] := Max[2 i - j, 2 j - i];
    m[n_] := Table[f[i, j], {i, 1, n}, {j, 1, n}]
    TableForm[m[8]] (* 8x8 principal submatrix *)
    Flatten[Table[f[i, n + 1 - i],
      {n, 1, 15}, {i, 1, n}]]  (* A204154 *)
    p[n_] := CharacteristicPolynomial[m[n], x];
    c[n_] := CoefficientList[p[n], x]
    TableForm[Flatten[Table[p[n], {n, 1, 10}]]]
    Table[c[n], {n, 1, 12}]
    Flatten[%]                 (* A204155 *)
    TableForm[Table[c[n], {n, 1, 10}]]

Formula

G.f. as array: (1 + x + y - 7*y*x + 2*y*x^2 + 2*y^2*x)*x*y/((1-x*y)*(1-x)^2*(1-y)^2). - Robert Israel, Dec 03 2017

A204021 Triangle read by rows: row n shows the coefficients of the characteristic polynomial of the n-th principal submatrix of min(2i-1,2j-1) (A157454).

Original entry on oeis.org

1, 1, -1, 2, -4, 1, 4, -12, 9, -1, 8, -32, 40, -16, 1, 16, -80, 140, -100, 25, -1, 32, -192, 432, -448, 210, -36, 1, 64, -448, 1232, -1680, 1176, -392, 49, -1, 128, -1024, 3328, -5632, 5280, -2688, 672, -64, 1, 256, -2304, 8640, -17472, 20592
Offset: 0

Views

Author

Clark Kimberling, Jan 11 2012

Keywords

Comments

Let p(n)=p(n,x) be the characteristic polynomial of the n-th principal submatrix. The zeros of p(n) are real, and they interlace the zeros of p(n+1). See A202605 and A204016 for guides to related sequences.
a(0)=1 by convention. - Philippe Deléham, Nov 17 2013
The n roots of the n-th polynomial are 1/(1+cos((2*k-1)*Pi/(2*n))) for k = 1..n. See my pdf in the link section for the proof. - Jianing Song, Dec 01 2023

Examples

			Top of the triangle:
  1
  1....-1
  2....-4.....1
  4....-12....9....-1
  8....-32....40...-16....1
  16...-80....140..-100...25....-1
  32...-192...432..-448...210...-36....1
  ...
-448=2*(-100)-2*140-(-32). - _Philippe Deléham_, Nov 17 2013
		

References

  • (For references regarding interlacing roots, see A202605.)

Crossrefs

Programs

  • Mathematica
    f[i_, j_] := Min[2 i - 1, 2 j - 1];
    m[n_] := Table[f[i, j], {i, 1, n}, {j, 1, n}]
    TableForm[m[6]] (* 6x6 principal submatrix *)
    Flatten[Table[f[i, n + 1 - i],
      {n, 1, 15}, {i, 1, n}]]   (* A157454 *)
    p[n_] := CharacteristicPolynomial[m[n], x];
    c[n_] := CoefficientList[p[n], x]
    TableForm[Flatten[Table[p[n], {n, 1, 10}]]]
    Table[c[n], {n, 1, 12}]
    Flatten[%]                  (* A204021 *)
    TableForm[Table[c[n], {n, 1, 10}]]

Formula

From Peter Bala, May 01 2012: (Start)
The triangle appears to be a signed version of the row reverse of A211957.
If true, then for 0 <= k <= n-1, T(n,k) = (-1)^k*n/(n-k)*2^(n-k-1)*binomial(2*n-k-1,k) and Sum_{k = 0..n} T(n,k)*x^(n-k) = 1/2*(-1)^n*(b(2*n,-2*x) + 1)/b(n,-2*x), where b(n,x) := Sum_{k = 0..n} binomial(n+k,2*k)*x^k are the Morgan-Voyce polynomials of A085478.
Conjectural o.g.f.: t*(1-x-x^2*t)/(1-2*t*(1-x)+t^2*x^2) = (1-x)*t + (2-4*x+x^2)*t^2 + .... (End)
T(n,k)=2*T(n-1,k)-2*T(n-1,k-1)-T(n-2,k-2), T(0,0)=T(1,0)=1, T(1,1)=-1, T(n,k)=0 of k<0 or if k>n. - Philippe Deléham, Nov 17 2013

A204158 Symmetric matrix based on f(i,j)=max(3i-2j, 3j-2i), by antidiagonals.

Original entry on oeis.org

1, 4, 4, 7, 2, 7, 10, 5, 5, 10, 13, 8, 3, 8, 13, 16, 11, 6, 6, 11, 16, 19, 14, 9, 4, 9, 14, 19, 22, 17, 12, 7, 7, 12, 17, 22, 25, 20, 15, 10, 5, 10, 15, 20, 25, 28, 23, 18, 13, 8, 8, 13, 18, 23, 28, 31, 26, 21, 16, 11, 6, 11, 16, 21, 26, 31, 34, 29, 24, 19, 14, 9, 9, 14
Offset: 1

Views

Author

Clark Kimberling, Jan 12 2012

Keywords

Comments

A204158 represents the matrix M given by f(i,j)=max(3i-2j, 3j-2i) for i>=1 and j>=1. See A204159 for characteristic polynomials of principal submatrices of M, with interlacing zeros. See A204016 for a guide to other choices of M.

Examples

			Northwest corner:
1....4....7....10...13
4....2....5....8....11
7....5....3....6....9
10...8....6....4....7
		

Crossrefs

Programs

  • Mathematica
    f[i_, j_] := Max[3 i - 2 j, 3 j - 2 i];
    m[n_] := Table[f[i, j], {i, 1, n}, {j, 1, n}]
    TableForm[m[8]] (* 8x8 principal submatrix *)
    Flatten[Table[f[i, n + 1 - i],
      {n, 1, 15}, {i, 1, n}]]   (* A204158 *)
    p[n_] := CharacteristicPolynomial[m[n], x];
    c[n_] := CoefficientList[p[n], x]
    TableForm[Flatten[Table[p[n], {n, 1, 10}]]]
    Table[c[n], {n, 1, 12}]
    Flatten[%]                  (* A204159 *)
    TableForm[Table[c[n], {n, 1, 10}]]

A204022 Symmetric matrix based on f(i,j) = max(2i-1, 2j-1), by antidiagonals.

Original entry on oeis.org

1, 3, 3, 5, 3, 5, 7, 5, 5, 7, 9, 7, 5, 7, 9, 11, 9, 7, 7, 9, 11, 13, 11, 9, 7, 9, 11, 13, 15, 13, 11, 9, 9, 11, 13, 15, 17, 15, 13, 11, 9, 11, 13, 15, 17, 19, 17, 15, 13, 11, 11, 13, 15, 17, 19, 21, 19, 17, 15, 13, 11, 13, 15, 17, 19, 21, 23, 21, 19, 17, 15, 13, 13, 15, 17, 19, 21, 23
Offset: 1

Views

Author

Clark Kimberling, Jan 11 2012

Keywords

Comments

This sequence represents the matrix M given by f(i,j) = max(2i-1, 2j-1) for i >= 1 and j >= 1. See A204023 for characteristic polynomials of principal submatrices of M, with interlacing zeros. See A204016 for a guide to other choices of M.

Examples

			Northwest corner:
  1 3 5 7 9
  3 3 5 7 9
  5 5 5 7 9
  7 7 7 7 9
  9 9 9 9 9
		

Crossrefs

Programs

  • GAP
    Flat(List([1..12], n-> List([1..n], k-> Maximum(2*k-1, 2*(n-k)+1) ))); # G. C. Greubel, Jul 23 2019
    
  • Magma
    [[Max(2*k-1, 2*(n-k)+1): k in [1..n]]: n in [1..12]]; // G. C. Greubel, Jul 23 2019
    
  • Mathematica
    (* First program *)
    f[i_, j_] := Max[2 i - 1, 2 j - 1];
    m[n_] := Table[f[i, j], {i, n}, {j, n}]
    TableForm[m[6]] (* 6 X 6 principal submatrix *)
    Flatten[Table[f[i, n + 1 - i],
      {n, 15}, {i, n}]]                (* A204022 *)
    p[n_] := CharacteristicPolynomial[m[n], x];
    c[n_] := CoefficientList[p[n], x]
    TableForm[Flatten[Table[p[n], {n, 10}]]]
    Table[c[n], {n, 12}]
    Flatten[%]                         (* A204023 *)
    TableForm[Table[c[n], {n, 10}]]
    (* Second program *)
    Table[Max[2*k-1, 2*(n-k)+1], {n, 12}, {k, n}]//Flatten (* G. C. Greubel, Jul 23 2019 *)
  • PARI
    {T(n, k) = max(2*k-1, 2*(n-k)+1)};
    for(n=1, 12, for(k=1, n, print1(T(n, k), ", "))) \\ G. C. Greubel, Jul 23 2019
    
  • Python
    from math import isqrt
    def A204022(n): return (m:=isqrt(n<<3)+1>>1)+abs(m**2-(n<<1)+1) # Chai Wah Wu, Jun 08 2025
  • Sage
    [[max(2*k-1, 2*(n-k)+1) for k in (1..n)] for n in (1..12)] # G. C. Greubel, Jul 23 2019
    

Formula

From Ridouane Oudra, May 27 2019: (Start)
a(n) = t + |t^2-2n+1|, where t = floor(sqrt(2n-1)+1/2).
a(n) = A209302(2n-1).
a(n) = A002024(n) + |A002024(n)^2-2n+1|.
a(n) = t + |t^2-2n+1|, where t = floor(sqrt(2n)+1/2). (End)

A204026 Symmetric matrix based on f(i,j)=min(F(i+1),F(j+1)), where F=A000045 (Fibonacci numbers), by antidiagonals.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 3, 2, 1, 1, 2, 3, 3, 2, 1, 1, 2, 3, 5, 3, 2, 1, 1, 2, 3, 5, 5, 3, 2, 1, 1, 2, 3, 5, 8, 5, 3, 2, 1, 1, 2, 3, 5, 8, 8, 5, 3, 2, 1, 1, 2, 3, 5, 8, 13, 8, 5, 3, 2, 1, 1, 2, 3, 5, 8, 13, 13, 8, 5, 3, 2, 1, 1, 2, 3, 5, 8, 13, 21, 13, 8, 5, 3, 2, 1, 1, 2, 3, 5, 8
Offset: 1

Views

Author

Clark Kimberling, Jan 11 2012

Keywords

Comments

A204026 represents the matrix M given by f(i,j)=min(F(i+1),F(j+1)) for i>=1 and j>=1. See A204027 for characteristic polynomials of principal submatrices of M, with interlacing zeros. See A204016 for a guide to other choices of M.

Examples

			Northwest corner:
1 1 1 1 1 1
1 2 2 2 2 2
1 2 3 3 3 3
1 2 3 5 5 5
1 2 3 5 8 8
1 2 3 5 8 13
		

Crossrefs

Programs

  • Mathematica
    f[i_, j_] := Min[Fibonacci[i + 1], Fibonacci[j + 1]]
    m[n_] := Table[f[i, j], {i, 1, n}, {j, 1, n}]
    TableForm[m[6]] (* 6x6 principal submatrix *)
    Flatten[Table[f[i, n + 1 - i],
      {n, 1, 15}, {i, 1, n}]]  (* A204026 *)
    p[n_] := CharacteristicPolynomial[m[n], x];
    c[n_] := CoefficientList[p[n], x]
    TableForm[Flatten[Table[p[n], {n, 1, 10}]]]
    Table[c[n], {n, 1, 12}]
    Flatten[%]                 (* A204027 *)
    TableForm[Table[c[n], {n, 1, 10}]]

A204028 Symmetric matrix based on f(i,j)=min(3i-2,3j-2), by antidiagonals.

Original entry on oeis.org

1, 1, 1, 1, 4, 1, 1, 4, 4, 1, 1, 4, 7, 4, 1, 1, 4, 7, 7, 4, 1, 1, 4, 7, 10, 7, 4, 1, 1, 4, 7, 10, 10, 7, 4, 1, 1, 4, 7, 10, 13, 10, 7, 4, 1, 1, 4, 7, 10, 13, 13, 10, 7, 4, 1, 1, 4, 7, 10, 13, 16, 13, 10, 7, 4, 1, 1, 4, 7, 10, 13, 16, 16, 13, 10, 7, 4, 1, 1, 4, 7, 10, 13, 16, 19, 16
Offset: 1

Views

Author

Clark Kimberling, Jan 11 2012

Keywords

Comments

A204028 represents the matrix M given by f(i,j)=min(3i-2,3j-2) for i>=1 and j>=1. See A204029 for characteristic polynomials of principal submatrices of M, with interlacing zeros. See A204016 for a guide to other choices of M.

Examples

			Northwest corner:
1...1...1...1....1....1
1...4...4...4....4....4
1...4...7...7....7....7
1...4...7...10...10...10
1...4...7...10...13...13
		

Crossrefs

Programs

  • Mathematica
    f[i_, j_] := Min[3 i - 2, 3 j - 2];
    m[n_] := Table[f[i, j], {i, 1, n}, {j, 1, n}]
    TableForm[m[6]] (* 6x6 principal submatrix *)
    Flatten[Table[f[i, n + 1 - i],
      {n, 1, 15}, {i, 1, n}]]  (* A204028 *)
    p[n_] := CharacteristicPolynomial[m[n], x];
    c[n_] := CoefficientList[p[n], x]
    TableForm[Flatten[Table[p[n], {n, 1, 10}]]]
    Table[c[n], {n, 1, 12}]
    Flatten[%]                 (* A204029 *)
    TableForm[Table[c[n], {n, 1, 10}]]

A204118 Symmetric matrix based on f(i,j) = gcd(prime(i), prime(j)), by antidiagonals.

Original entry on oeis.org

2, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 11, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 13, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 17, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 1

Views

Author

Clark Kimberling, Jan 11 2012

Keywords

Comments

A204118 represents the matrix M given by f(i,j) = gcd(prime(i), prime(j)) for i >= 1 and j >= 1. See A204119 for characteristic polynomials of principal submatrices of M, with interlacing zeros. See A204016 for a guide to other choices of M.

Examples

			Northwest corner:
  2  1  1  1  1
  1  3  1  1  1
  1  1  5  1  1
  1  1  1  7  1
  1  1  1  1 11
		

Crossrefs

Programs

  • Mathematica
    f[i_, j_] := GCD[Prime[i], Prime[j]];
    m[n_] := Table[f[i, j], {i, 1, n}, {j, 1, n}]
    TableForm[m[8]] (* 8 X 8 principal submatrix *)
    Flatten[Table[f[i, n + 1 - i],
      {n, 1, 15}, {i, 1, n}]]  (* A204118 *)
    p[n_] := CharacteristicPolynomial[m[n], x];
    c[n_] := CoefficientList[p[n], x]
    TableForm[Flatten[Table[p[n], {n, 1, 10}]]]
    Table[c[n], {n, 1, 12}]
    Flatten[%]                 (* A204119 *)
    TableForm[Table[c[n], {n, 1, 10}]]
Showing 1-10 of 73 results. Next