OFFSET
1,15
COMMENTS
Given n points, sort them into the most-square rectangular point lattice possible. Now sort the points into square point lattices of dimension equal to the lesser dimension of the earlier rectangle. a(n) is the number of points left over. a(n) is trivially 0 for prime numbers n (the most-square and only rectangular point lattice on a prime number of points is a linear point lattice). a(n) != 0 iff n is a member of A080363.
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..65537
Eric Weisstein's World of Mathematics, Point Lattice.
Eric Weisstein's World of Mathematics, Divisor.
EXAMPLE
a(6)=1 because the least divisor of 6 greater than sqrt(6) is 3, the greater divisor of 6 less than sqrt(6) is 2 and 3 mod 2 = 1
MATHEMATICA
num[n_] := If[OddQ[DivisorSigma[0, n]], Sqrt[n], Divisors[n][[DivisorSigma[0, n]/2 + 1]]] den[n_] := If[OddQ[DivisorSigma[0, n]], Sqrt[n], Divisors[n][[DivisorSigma[0, n]/2]]] Table[Mod[num[n], den[n]], {n, 1, 128}]
PROG
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Joseph Biberstine (jrbibers(AT)indiana.edu), Dec 17 2004
EXTENSIONS
Definition corrected by Antti Karttunen, Sep 23 2018
STATUS
approved