OFFSET
1,1
COMMENTS
Pairs ((0, 1), (0, 0)) and ((0, 0), (0, 1)) are considered equal since they have the same points. ((0, 0), (0, 0)) isn't counted the distance between the points included isn't a positive integer. The x's and y's of points in a pair may differ due to Pythagoras, for example ((0, 0), (3, 4)).
LINKS
David A. Corneth, Table of n, a(n) for n = 1..10560
Wikipedia, Pythagorean triple
PROG
(PARI) a(n)=my(tot=n*(n+1)^2); forstep(i=1, sqrt(ceil(sqrt(n))^2)*(1+sqrt(2))\1, 2, forstep(j=2, max(sqrt(ceil(sqrt(n+i^2))^2)\1, n\(2*i))*(1+sqrt(2))\1, 2, if(gcd(i, j)==1, for(k=1, n\max(2*i*j, abs(j^2-i^2)),
tot+=(n-2*i*j*k+1)*(n-abs(j^2-i^2)*k+1)*4)))); tot \\David A. Corneth
CROSSREFS
KEYWORD
nonn
AUTHOR
David A. Corneth, Aug 10 2013
STATUS
approved