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
Michael S. Branicky, Table of n, a(n) for n = 1..1000
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
From Michael S. Branicky, Jan 16 2021: (Start)
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
print([a(n) for n in range(1, 39)]) # Michael S. Branicky, Jan 16 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
John W. Layman, Dec 13 2000
EXTENSIONS
a(31) and beyond from Michael S. Branicky, Jan 16 2021
STATUS
approved