############################################################################ # # File: satin.icn # # Subject: Procedure to generate satin tie-up counters # # Author: Ralph E. Griswold # # Date: March 22, 2000 # ############################################################################ # # This file is in the public domain. # ############################################################################ # # This program generates the small of the satin counters for a number of # shafts read from standard input. # ############################################################################ # # Requires: Version 9 graphics # ############################################################################ # # Links: numbers # ############################################################################ link numbers procedure counter(i) local j, k, m, rows, results results := [] every j := 2 to i / 2 do if gcd(j, i - j) = 1 then put(results, j) write("i=", i, ": ", *results, " counters") every writes(!results, " ") write() write() end procedure main() while i := read() do counter(i) end