login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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

%I #12 Jan 17 2021 11:25:15

%S 1,16,73,208,465,896,1561,2528,3873,5680,8041,11056,14833,19488,25145,

%T 31936,40001,49488,60553,73360,88081,104896,123993,145568,169825,

%U 196976,227241,260848,298033,339040

%N 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).

%C 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,...}.

%H Michael S. Branicky, <a href="/A058333/b058333.txt">Table of n, a(n) for n = 1..1000</a>

%F The terms a(1) through a(30) are given by a(n) = (n^4+8n^3-10n^2+4n)/3.

%F Empirical g.f.: x*(x+1)*(7*x^2-10*x-1) / (x-1)^5. - _Colin Barker_, Mar 29 2013

%F From _Michael S. Branicky_, Jan 16 2021: (Start)

%F 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||].

%F The terms a(1) through a(1000) satisfy a(n) = (n^4+8n^3-10n^2+4n)/3. (End)

%o (Python)

%o from numba import njit

%o @njit

%o def a(n):

%o count = 0

%o for i in range(n):

%o for j in range(n):

%o for k in range(n):

%o for l in range(n):

%o if abs(abs(i-j) - abs(k-l)) == abs(abs(i-k) - abs(j-l)):

%o count += 1

%o return count

%o print([a(n) for n in range(1, 39)]) # _Michael S. Branicky_, Jan 16 2021

%K nonn

%O 1,2

%A _John W. Layman_, Dec 13 2000

%E a(31) and beyond from _Michael S. Branicky_, Jan 16 2021

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 16 01:01 EDT 2024. Contains 371696 sequences. (Running on oeis4.)