OFFSET
0,3
LINKS
Indranil Ghosh, Table of n, a(n) for n = 0..150
MATHEMATICA
f[n_] := f[n] = Block[{a, b, c, d, s = 0}, a = -n; While[a < n +1, b = -n; While[b < n +1, c = -n; While[c < n +1, d = -n; While[d < n +1, If[ a != b && a != c && a != d && b != c && b != d && c != d && a*d + b*c == a + d, s++]; d++]; c++]; b++]; a++]; s]; Array[f, 40, 0] (* Robert G. Wilson v, Dec 03 2016 *)
PROG
(Python)
def t(n):
s=0
for a in range(-n, n+1):
for b in range(-n, n+1):
for c in range(-n, n+1):
for d in range(-n, n+1):
if (a!=b and a!=d and b!=d and c!=a and c!=b and c!=d):
if (a*d+b*c)==a+d:
s+=1
return s
for i in range(0, 151):
print str(i)+" "+str(t(i))
CROSSREFS
KEYWORD
nonn
AUTHOR
Indranil Ghosh, Dec 03 2016
STATUS
approved