Throughout the paper, we use to denote the greatest common divisor (gcd) of the integers , and write for an ordered -tuple of integers. Let , . A linear congruence in unknowns is of the form
Let , . The linear congruence has a solution if and only if , where . Furthermore, if this condition is satisfied, then there are solutions.
Counting the number of solutions of the above congruence with some restrictions on the solutions is also a problem of great interest. As an important example, one can mention the restrictions (), where are given positive divisors of . The number of solutions of the linear congruences with the above restrictions, which were called restricted linear congruences in , was first considered by Rademacher  in 1925 and Brauer  in 1926, in the special case of , and they proved the following nice formula for the number of such solutions:
where is Euler’s totient function and the products are taken over all prime divisors of . Since then, this problem has been studied, in several other special cases, in many papers (very recently, in was studied in its ‘most general case’ in ) and has found very interesting applications in number theory, combinatorics, geometry, computer science, cryptography etc; see [3, 4, 6, 7, 9, 11] for a detailed discussion about this problem and a comprehensive list of references. Another restriction of potential interest is imposing the condition that all are distinct modulo . Unlike the first problem, there seems to be very little published on the second problem. Recently, Grynkiewicz et al. , using tools from additive combinatorics and group theory, proved necessary and sufficient conditions under which the linear congruence , where () are arbitrary integers, has a solution with all distinct modulo ; see also [1, 10] for connections to zero-sum theory and  for connections to coding theory. So, it would be an interesting problem to give an explicit formula for the number of such solutions. Quite surprisingly, this problem was first considered, in a special case, by Schönemann  almost two centuries ago(!) but his result seems to have been forgotten. Schönemann  proved the following result:
Let be a prime, be arbitrary integers, and but for all . The number of solutions of the linear congruence , with all distinct modulo , is independent of the coefficients and is equal to
In this paper, we generalize Schönemann’s theorem using Proposition 1.1 and a result on graph enumeration recently obtained by Ardila et al. . This seems to be a rather uncommon method in the area; besides, our proof technique or its modifications may be useful for dealing with other cases of this problem (or even the general case) or other relevant problems. We state and prove our main result in the next section.
2 Main Result
Our generalization of Schönemann’s theorem is obtained via a graph theoretic method which may be also of independent interest. We need two formulas on graph enumeration (see Theorem 2.2 below) recently obtained by Ardila et al. . These formulas are in terms of the deformed exponential function which is a special case of the three variable Rogers-Ramanujan function defined below. These functions have interesting applications in combinatorics, complex analysis, functional differential equations, and statistical mechanics (see [2, 12, 13, 15, 18, 19] and the references therein).
The three variable Rogers-Ramanujan function is
Also, the deformed exponential function is
Let be the number of simple graphs with connected components, edges, and vertices labeled , and be the number of simple connected graphs with edges and labeled vertices. Suppose that
Ardila et al.  proved that:
The generating functions for counting simple graphs and simple connected graphs satisfy, respectively,
where is the deformed exponential function defined above.
Now, we are ready to state and prove our main result:
Let be arbitrary integers, and for all . The number of solutions of the linear congruence , with all distinct modulo , is
Let be a solution of the linear congruence . We construct a graph with vertex set and connect the vertices and if and only if , . Note that our desired solutions are those for which none of the equalities , , hold. So, we find the number of solutions satisfying of these equalities (without knowing which equalities), and then use the inclusion-exclusion principle. Note that when of these equalities hold, the corresponding graphs have then edges, but we do not know the number of connected components that we call (so, we should consider all possibilities of ). In fact, since we do not know which equality holds, we do not know anything about the adjacency relations. What we know is only that the corresponding graphs have vertices and edges. Note that each adjacency relation defines a unique set of restrictions , , and vice versa. So, we should figure out how many graphs we can construct given vertices and edges. Here the number of connected components, , is very important. By this construction, the number of solutions of the linear congruence , with some equal to each other modulo , is now directly related to the number of connected components of graph . In fact, when some are equal to each other modulo , then by connecting their indices (as vertices of the graph ) we get a connected component of , and we can simplify the linear congruence by grouping the which are equal to each other modulo . This procedure eventually gives a new linear congruence in which the coefficients are of the form , where , and the number of terms is equal to the number of connected components of the corresponding graph. Therefore, for finding the number of solutions of the linear congruence , with some equal to each other modulo , we first construct the corresponding graph. If this graph has connected components then since for all , by Proposition 1.1 the number of solutions of the linear congruence with those equal to each other modulo is equal to . Also, if this graph is connected, that is, (which means that all are equal to each other modulo ) then the linear congruence has just one term (and its coefficient is ), and so, by Proposition 1.1 the number of solutions in this case, we denote it by , is equal to if , and is equal to zero otherwise. Let be the number of simple graphs with connected components, edges, and vertices labeled , and be the number of simple connected graphs with edges and labeled vertices. Now, by the inclusion-exclusion principle, we have
where is the deformed exponential function. Note that . Now, we have
Consequently, the number of solutions of the linear congruence , with all distinct modulo , is
Note that in Schönemann’s theorem, is zero and is prime but in Theorem 2.3, both and are arbitrary.
It would be an interesting problem to see if the technique presented in this paper can be modified so that it covers the problem in its full generality. So, we pose the following question.
Problem 1. Let () be arbitrary integers. Give an explicit formula for the number of solutions of the linear congruence with all distinct modulo .
Such results would be interesting from several aspects. As we mentioned in the Introduction, the number of solutions of the linear congruence with the restrictions (), where are given positive divisors of , has found very interesting applications in number theory, combinatorics, geometry, computer science, cryptography etc. Therefore, having an explicit formula for the number of solutions with all distinct modulo may also lead to interesting applications in these or other directions. The problem may also have implications in zero-sum theory (see [1, 10]) and in coding theory (see ).
During the preparation of this work the first author was supported by a Fellowship from the University of Victoria (UVic Fellowship).
-  D. Adams and V. Ponomarenko, Distinct solution to a linear congruence, Involve 3 (2010), 341–344.
-  F. Ardila, F. Castillo, and M. Henley, The arithmetic Tutte polynomials of the classical root systems, Int. Math. Res. Not. 2015 (2015), 3830–3877.
-  K. Bibak, B. M. Kapron, and V. Srinivasan, Counting surface-kernel epimorphisms from a co-compact Fuchsian group to a cyclic group with motivations from string theory and QFT, Nuclear Phys. B 910 (2016), 712–723.
-  K. Bibak, B. M. Kapron, and V. Srinivasan, On a restricted linear congruence, Int. J. Number Theory 12 (2016), 2167–2171.
-  K. Bibak, B. M. Kapron, and V. Srinivasan, Unweighted linear congruences with distinct coordinates and the Varshamov–Tenengolts codes, Des. Codes Cryptogr., to appear.
-  K. Bibak, B. M. Kapron, V. Srinivasan, R. Tauraso, and L. Tóth, Restricted linear congruences, J. Number Theory 171 (2017), 128–144.
-  K. Bibak, B. M. Kapron, V. Srinivasan, and L. Tóth, On an almost-universal hash function family with applications to authentication and secrecy codes, Internat. J. Found. Comput. Sci., to appear; https://eprint.iacr.org/2015/1187.
-  A. Brauer, Lösung der Aufgabe 30, Jber. Deutsch. Math.–Verein 35 (1926), 92–94.
-  E. Cohen, A class of arithmetical functions, Proc. Natl. Acad. Sci. USA 41 (1955), 939–944.
-  D. J. Grynkiewicz, A. Philipp, and V. Ponomarenko, Arithmetic-progression-weighted subsequence sums, Israel J. Math. 193 (2013), 359–398.
-  D. Jacobson and K. S. Williams, On the number of distinguished representations of a group element, Duke Math. J. 39 (1972), 521–527.
-  V. P. Kostov and B. Shapiro, Hardy-Petrovitch-Hutchinson’s problem and partial theta function, Duke Math. J. 162 (2013), 825-861.
-  J. K. Langley, A certain functional-differential equation, J. Math. Anal. Appl. 244 (2000), 564–567.
-  D. N. Lehmer, Certain theorems in the theory of quadratic residues, Amer. Math. Monthly 20 (1913), 151–157.
-  Y. Liu, On some conjectures by Morris et al., about zeros of an entire function, J. Math. Anal. Appl. 226 (1998), 1–5.
-  H. Rademacher, Aufgabe 30, Jber. Deutsch. Math.–Verein 34 (1925), 158.
-  T. Schönemann, Theorie der symmetrischen Functionen der Wurzeln einer Gleichung. Allgemeine Sätze über Congruenzen nebst einigen Anwendungen derselben, J. Reine Angew. Math. 1839 (1839), 231–243.
-  A. D. Scott and A. D. Sokal, The repulsive lattice gas, the independent-set polynomial, and the Lovász local lemma, J. Stat. Phys. 118 (2005), 1151–1261.
-  A. D. Sokal, The leading root of the partial theta function, Adv. Math. 229 (2012), 2603–2621.