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.

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