OFFSET
0,3
COMMENTS
For n >= 5, this is the maximal number of pairs of points at unit distance in a set of n points in R^4.
REFERENCES
K. J. Swanepoel, Unit distances and diameters in Euclidean spaces, Discrete Comput. Geom., 41 (No. 1, 2009), 1-27.
LINKS
Index entries for linear recurrences with constant coefficients, signature (2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -2, 1).
FORMULA
a(n)=2*a(n-1)-a(n-2)+a(n-40)-2*a(n-41)+a(n-42). [From R. J. Mathar, Feb 13 2009]
MAPLE
f:=proc(n) if n mod 8 = 0 or n mod 10 = 0 then floor(n^2/4)+n else floor(n^2/4)+n-1; fi; end;
MATHEMATICA
Table[Which[Mod[n, 8]==0, Floor[n^2/4]+n, Mod[n, 10]==0, Floor[ n^2/4]+ n, True, Floor[n^2/4]+n-1], {n, 0, 70}] (* or *) LinearRecurrence[{2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -2, 1}, {0, 0, 2, 4, 7, 10, 14, 18, 24, 28, 35, 40, 47, 54, 62, 70, 80, 88, 98, 108, 120, 130, 142, 154, 168, 180, 194, 208, 223, 238, 255, 270, 288, 304, 322, 340, 359, 378, 398, 418, 440, 460}, 70] (* Harvey P. Dale, Dec 24 2015 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Feb 13 2009
STATUS
approved