OFFSET
1,2
COMMENTS
Stable modules arise in Edwards's recasting of Gauss's theory of binary quadratic forms. See either Edwards reference for the definitions of stable modules and canonical form.
REFERENCES
Harold M. Edwards, Essays in Constructive Mathematics, Springer, 2005, page 80 and pages 90-92.
Harold M. Edwards, Higher Arithmetic: An Algorithmic Introduction to Number Theory, American Mathematical Society, 2008, page 119 and pages 169-177.
FORMULA
a(n) = 0 when n is a square.
EXAMPLE
For n = 5 the a(5) = 5 stable modules are [1, sqrt(5)], [5, sqrt(5)], [2, 1 + sqrt(5)], [4, 1 + sqrt(5)], [4, 3 + sqrt(5)]. Applying Edwards' comparison algorithm to each stable module partitions them into two cycles: [1, sqrt(5)] -> [4, 3 + sqrt(5)] -> [5, sqrt(5)] -> [4, 1 + sqrt(5)] -> [1, sqrt(5)] and [2, 1 + sqrt(5)] -> [2, 1 + sqrt(5)].
MATHEMATICA
Table[
Length[If[
IntegerQ[Sqrt[n]],
{},
Join @@ Table[
Join @@ Function[f,
If[k == 0 || 2 k == f,
{{f, k + Sqrt[n]}},
{{f, k + Sqrt[n]}, {f, f - k + Sqrt[n]}}
]
] /@ Select[Divisors[n - k^2], Function[f, f >= 2 k]],
{k, 0, Sqrt[n]}
]
]],
{n, 1, 100}
]
CROSSREFS
KEYWORD
nonn
AUTHOR
Eric Rowland, Dec 31 2018
STATUS
approved