A204162 Symmetric matrix based on f(i,j) = (floor((i+1)/2) if i=j and = 1 otherwise), by antidiagonals.
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 1
Examples
Northwest corner: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 2 1 1 1 1 1 1 3 1 1 1 1 1 1 3
Links
Programs
-
Mathematica
f[i_, j_] := 1; f[i_, i_] := Floor[(i + 1)/2]; 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}]] (* A204162 *) 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[%] (* A204163 *) TableForm[Table[c[n], {n, 1, 10}]]
-
PARI
up_to = 65703; \\ = binomial(362+1,2) A204162sq(row,col) = if(row==col,(row+1)\2,1); A204162list(up_to) = { my(v = vector(up_to), i=0); for(a=1,oo, for(col=1,a, if(i++ > up_to, return(v)); v[i] = A204162sq((a-(col-1)),col))); (v); }; v204162 = A204162list(up_to); A204162(n) = v204162[n]; \\ Antti Karttunen, Nov 06 2018
Extensions
Definition corrected to match with terms by Antti Karttunen, Nov 06 2018
Comments