|
|
A058333
|
|
Number of 3 X 3 matrices with elements from [0,...,(n-1)] satisfying the condition that the middle element of each row or column is the difference of the two end elements (in absolute value).
|
|
1
|
|
|
1, 16, 73, 208, 465, 896, 1561, 2528, 3873, 5680, 8041, 11056, 14833, 19488, 25145, 31936, 40001, 49488, 60553, 73360, 88081, 104896, 123993, 145568, 169825, 196976, 227241, 260848, 298033, 339040
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
If the "middle element" condition in the definition is also placed on the two diagonal lines of three in addition to each row and column, the sequence generated is the sequence of squares {1,4,9,16,...}.
|
|
LINKS
|
|
|
FORMULA
|
The terms a(1) through a(30) are given by a(n) = (n^4+8n^3-10n^2+4n)/3.
Empirical g.f.: x*(x+1)*(7*x^2-10*x-1) / (x-1)^5. - Colin Barker, Mar 29 2013
a(n) = Sum_{i=0..n-1} Sum_{j=0..n-1} Sum_{k=0..n-1} Sum_{l=0..n-1} [||i - k| - |j - l|| == ||i - j| - |k - l||].
The terms a(1) through a(1000) satisfy a(n) = (n^4+8n^3-10n^2+4n)/3. (End)
|
|
PROG
|
(Python)
from numba import njit
@njit
def a(n):
count = 0
for i in range(n):
for j in range(n):
for k in range(n):
for l in range(n):
if abs(abs(i-j) - abs(k-l)) == abs(abs(i-k) - abs(j-l)):
count += 1
return count
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|