A204164 Symmetric matrix based on f(i,j) = floor((i+j)/2), by antidiagonals.
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
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
Links
- Boris Putievskiy, Table of n, a(n) for n = 1..9870
- Boris Putievskiy, Integer Sequences: Irregular Arrays and Intra-Block Permutations, arXiv:2310.18466 [math.CO], 2023.
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
Comments