THE NUMBER OF LABELED CONNECTED GRAPHS MODULO PRIME POWERS

Let cn denote the number of vertex-labeled connected graphs on n vertices. Using group actions and elementary number theory, we show that the infinite sequence, cn : n ≥ 1, is ultimately periodic modulo every positive integer. We state and prove our results for sequences defined by a weighted generalization of cn and conjecture that these results are suggestive of similar periodic behavior of the Tutte polynomial evaluations of the complete graph Kn at integer points.


Introduction.
Let C n be the set of labeled connected graphs on the n-vertex set {1, 2, . . ., n}.For b ∈ Z, we define the weighted sum (1) C n (b) where |G| denotes the number of edges of graph G. Counting the number of vertexlabeled connected graphs on n vertices, equivalently finding C n (2), is a classical graph enumeration problem (see, for example, [5], [6], [9], [11]).While we know of no simple closed form for C n (2), there are some useful recurrence relations.For example, if we write c n = C n (2), [6] gives the recurrence More generally, when b is a positive integer, the sum C n (b) is equivalent to (up to easily computable factors) the all-terminal reliability polynomial1 of the complete graph on n vertices K n , and is thus useful in computing the probability that the n vertices remain connected when each edge has an independent failure probability of 1/b (see [3] for details).The function C n (b) for 1 ≤ n ≤ 7 is shown in Table 2 (in Appendix B).
The Tutte polynomial of a graph is a well-known two-variable graph polynomial and is defined for the complete graph K n by where G n is the set of all labeled graphs on the vertex set {1, 2, . . ., n}, and κ(G) is the number of connected components of the graph G.There is extensive literature on this graph invariant, and we refer the reader to [10] for an introduction.The sum C n (b) is also an evaluation of the Tutte polynomial of K n at the integer point (1, b).
In this paper, we establish the following recurrence congruence for C n (b).Our statement of this recurrence uses the arithmetic function ϕ(m), called the Euler totient function, which is defined as the number of integers a ∈ {1, 2, . . ., m} such that gcd(a, m) = 1 [1, p. 54].In particular, for a prime p and positive integer k, we have ϕ(p k ) = p k−1 (p − 1).Where relevant, negative exponents when taking a modulus refer to multiplicative inverses.Proposition 1.Let p be a prime, and let k be a positive integer.For b, n ∈ Z such that n ≥ p k and b ≡ 1 (mod p), we have The rest of this paper is organized as follows.We prove Proposition 1 in section 2. When b ≡ 0 (mod p), we know by Fermat's little theorem [1, Corollary 5-2] that b ϕ(p) ≡ 1 (mod p), and thus b ϕ(p)/2 ≡ ±1 (mod p).From Lemma 2 (in Appendix A), this also means b ϕ(p k )/2 ≡ ±1 (mod p k ).Thus Proposition 1 implies C n (b) is periodic or antiperiodic in n when reduced modulo p k whenever b ≡ 1 (mod p) (see section 3.2).We discuss this periodic behavior of C n (b) and its consequences in section 3. Integer sequences that are ultimately periodic modulo every positive integer were called modularly C-finite (MC-finite) in [4], and it was unknown if the sequence of numbers of labeled connected graphs on n vertices was MC-finite.In section 3 we prove that this sequence, that is, (C n (2) : n ≥ 1) in our notation, is MC-finite.Table 3 shows the first few terms of this sequence and their periodic behavior modulo some small positive integers.In section 4 we conclude with open questions on similar recurrence congruences for the Tutte polynomial evaluations of K n at other integer points, that is, for T n (a, b) where a, b ∈ Z. Appendix A lists the number theoretic results used in our proofs.
For brevity, unless otherwise indicated the domain of all numerical quantities in this paper is the set of integers.

Proof of Proposition 1.
Our proof of Proposition 1 uses permutation group actions on sets of labeled connected graphs on n + p k vertices to obtain the recurrence congruences, where p is a prime, k ≥ 1, and n ≥ 0.
We begin with the following useful observation; it characterizes circulant graphs (i.e., those that admit a cyclic automorphism without fixed vertices) with an odd prime number of vertices.Lemma 1.Let p be an odd prime, let V = {v 1 , v 2 , . . ., v p } be a set with p elements, and let σ be the permutation (v 1 , v 2 , . . ., v p ).Additionally, let E i be the set of edges of the p-cycle defined by E i = {{v, σ i v} : v ∈ V } for integers i in the range 1 ≤ i ≤ (p − 1)/2.Then σ is an automorphism of the graph G = (V, E) if and only if E is a disjoint union of a (possibly empty) subset of {E 1 , E 2 , . . ., E (p−1)/2 }.
Proof.Clearly, σ is an automorphism for the empty graph on V , and for each p-cycle (V, E i ) for 1 ≤ i ≤ (p − 1)/2.Hence σ is also an automorphism of a disjoint union of any subset of {E 1 , E 2 , . . ., E (p−1)/2 }.
To prove the converse, suppose σG = G = (V, E).If G has no edges, then the result is vacuously true.Otherwise, since the union of all E i 's is the complete graph on V , every edge in E is of the form {v, σ i v} for some v ∈ V and i ∈ {1, 2, . . ., (p − 1)/2}.However, if {v, σ i v} ∈ E, then because σG = G, we must have E i ⊆ E. Since this is true for every edge in E, it must be a disjoint union of some subset of {E 1 , E 2 , . . ., E (p−1)/2 }.
We prove Proposition 1 by considering the cases n > p k and n = p k separately.The case n > p k is easily seen to be equivalent to the following theorem.
Theorem 1.Let p be a prime, and let k, n be positive integers.If b ≡ 1 (mod p), then Proof.Let z = b − 1, and let C be the set of labeled connected graphs on the vertex set V = {1, 2, . . ., p k + n}.Then from (1), ( 2) We consider the action of the cyclic permutation group generated by the permutation α = (1, 2, . . ., p k ) on the set C. This action partitions the set C into orbits.By the orbit-stabilizer theorem [2, Theorem 17.2], the size of the orbit containing a graph G is p k unless its stabilizer is nontrivial, whence we have α p k−1 G = G.All graphs within an orbit are isomorphic to one another and hence contribute the same value to the sum in (2).Thus, In other words, when reduced modulo p k , it is enough to compute the sum (2) for those graphs for which α p k−1 is an automorphism.Note that the permutation , where the σ i 's are the mutually disjoint p-cycles (i, Let D be the set of labeled connected graphs on the (n + p k−1 )-vertex set P ∪ N .
We now outline a procedure for generating all the graphs in A from those in D. To do this, however, we first need some auxiliary information.For each i in the range 1 ≤ i ≤ p k−1 , we choose a graph S i ∈ S i , where S i is the collection of all graphs on the vertex set u i that admit the automorphism σ i .Clearly, we have |S i | independent choices for each S i .Additionally, given a G ∈ D, for each P -to-P edge {u i , u j } in G , we choose a nonempty subset w ij ⊆ u j .Since |u j | = p, we have 2 p − 1 independent choices for our w ij for every P -to-P edge in G .Let W (G ) = (w ij : {u i , u j } ∈ E(G )) be the tuple of our chosen w ij 's for a given G .Given our choices S 1 , S 2 , . . ., S p k−1 , graph G ∈ D, and an associated W (G ), we use the procedure outlined in Table 1 to generate a G ∈ A that has α p k−1 as an automorphism.This procedure is also illustrated with an example in Figure 1.
(a) Beginning with G as the graph with no edges on the set V , copy all edges from G to G with both endpoints in the set N .
Add the p|w ij | edges from the set   Indeed we have α p k−1 G = G after every step in Table 1, and thus α p k−1 is an automorphism of the generated graph G.It is also easy to verify that if G is connected, N is nonempty and the subsets w ij in step (d) above are nonempty, the generated graph G will be necessarily connected, and hence G ∈ A. (Note that the generated graph is not always connected if N is empty, and so n > 0 is a necessary condition for this proof.We handle the n = 0 case in Theorem 2.) Conversely, starting from any G ∈ A, this generation procedure can be reversed to obtain the graphs S 1 , S 2 , . . ., S p k−1 , G and the associated W (G ).Hence, by running through all possible choices of S 1 , S 2 , . . ., S p k−1 , G and W (G ), we generate every G ∈ A exactly once using the procedure in Table 1.
Given G ∈ D, let e(G ) and f (G ) be its number of P -to-P edges and N -to-P edges, respectively.We compute the number of edges of the generated graph G as follows.In step (a), we add In step (c), we add p edges for every N -to-P edge of G , and thus add another pf (G ) edges to G. Lastly, in step (d), we add p|w ij | edges for every P -to-P edge {u i , u j } of G .Based on this, we can rewrite (3) as ( 4) where we define and ( 6) by the binomial theorem.
Here the factor π accounts for all edges added in step (b), and τ (G ) accounts for the edges added in step (d).It is also worth mentioning here that often there are and hence b ≡ 1 (mod p) (equivalently, z ≡ 0 (mod p)) is a necessary condition for (4) to be valid.
To complete the rest of the proof, we consider the cases p ≥ 3 and p = 2 separately.Case p ≥ 3.In this case, from Lemma 1 we know graphs in S i are precisely the disjoint unions of subsets of H i H i , where H i is the set of (p − 1)/2 edge disjoint p-cycle graphs on u i that admit the automorphism σ i .That is, |S i | = 2 (p−1)/2 , and for every S i ∈ S i there is a unique subset H i ⊆ H i such that S i is the union of p-cycles in H i .Hence, from (5), we get [by the binomial theorem] To further simplify (4) in this case, we consider the action of the cyclic permutation group generated by γ = (u 1 , u 2 , . . ., u p k−1 ) on the set D. This action induces a partition R of orbits on D. The graphs within an orbit R ∈ R are isomorphic to each other and thus make the same contribution to the sum in (4).Let t(R), e(R), and f (R) be the number of all edges, P -to-P edges, and N -to-P edges, respectively, for graphs in orbit R, and let τ (R) be the common value of τ (G ) for all G ∈ R. We can then rewrite (4) as follows: We simplify (7) using the following claim.
Claim 1.For every orbit R ∈ R as defined above, (i) Proof.Let G ∈ R. By the orbit-stabilizer theorem, |R| = p j , where j is the smallest integer in the range 0 ≤ j ≤ k − 1 such that γ p j G = G .The permutation γ p j has p j disjoint cycles each of length p k−1−j .Since γ p j G = G , all p k−1−j vertices within each of these cycles must have the same number of edges to other vertices in P , and to vertices in N .Thus, where δ q and μ q are the number of edges from a vertex in the qth cycle of γ p j to other vertices in P and N , respectively.In particular, e(R) ≡ f (R) ≡ 0 (mod p k−1−j ).We now consider each of the two claims individually.
Using Claim 1 and remembering z ≡ 0 (mod p), we can rewrite (7) as This completes the proof of the case p ≥ 3.
Case p = 2.When p = 2, we have |u i | = 2 for all 1 ≤ i ≤ 2 k−1 , and the corresponding S i contains two graphs, one with no edges, and the other with the single edge {i, 2 k−1 + i}.Hence, from (5) we get since b is even.The proof for this case now follows from (4).
We next handle the case n = p k of Proposition 1.We state this case in the following equivalent form.Theorem 2. Let p be a prime and let k be a positive integer.If b ≡ 1 (mod p), then Proof.We reuse the notation used in the proof of Theorem 1.Our proof here is very similar to the proof of Theorem 1, except now the set N is empty.Using the same procedure from Table 1 to generate graphs G that admit α p k−1 as an automorphism, we find that for certain choices of S 1 , . . ., S p k−1 , G , and W (G ), the generated graph G may not be connected, and thus may not be in A. We show an example of such a G in Figure 2.  We prove our result by removing the contribution of such disconnected graphs from the sum on the right-hand side of (4).Let D p k (b) denote the contribution of disconnected graphs to this sum.
To compute D p k (b), we begin by observing the following necessary and sufficient conditions for a graph G generated from S 1 , S 2 , . . ., S p k−1 , G , and W (G ) using the procedure in Table 1 to be disconnected.
(i) For all 1 ≤ i ≤ p k−1 , the graph S i contains no edges.Otherwise, Lemma 1 implies u i induces a connected subgraph of G. Also, as G is connected and every w ∈ W (G ) is nonempty, any vertex x ∈ u j , j = i, is connected (by a path) to some vertex in the set u i in G, and thus is also connected to any other vertex in G, implying G is connected.(ii) For every distinct pair u i , u j ∈ P , any x ∈ u i is connected (by a path) to exactly one vertex y ∈ u j in the graph G.
As before, since G is connected and every w ∈ W (G ) is nonempty, any x ∈ u i is connected to some y ∈ u j in the generated graph G. Suppose for a contradiction that x is connected to two distinct vertices y 1 , y 2 ∈ u j in G. Then since α p k−1 is an automorphism of G, every vertex in u i is connected to every vertex in u j in G, and, in turn, also connected to each other.Additionally, for any other vertex v ∈ u in G ( = i, j), v must be connected to some vertex in the set u i , and thus also connected to every other vertex in G.But this would mean that G is connected.
The condition (ii) implies that if G is generated from G ∈ D using Table 1 and G ∈ A, then |w| = 1 for all w ∈ W (G ).Thus, together with condition (i), we know its number of edges |G| = p|G |.In other words, all disconnected graphs generated from a given G ∈ D contain the same number of edges, and thus make the same contribution to D p k (b).
We now count the number of disconnected graphs generated from a given G ∈ D as follows.When k = 1, our conditions imply that there is exactly one generated graph that is disconnected (the graph with p isolated vertices).When k > 1, from condition (ii), the vertex 1 in G is connected to exactly one vertex from each of the sets u 2 , u 3 , . . ., u p k−1 .For a given G ∈ D, these p k−1 − 1 vertex choices, along with the automorphism α p k−1 , fully determine the generated disconnected graph G.That is, we have p independent choices for each u i , 2 ≤ i ≤ p k−1 , to generate a disconnected G from any G , and thus every G ∈ D generates p p k−1 −1 disconnected graphs.Hence, the total contribution of disconnected graphs to the sum in ( 4) is ( 8) The formula in Theorem 1 does not apply when n = 0 because it includes a contribution from disconnected graphs, i.e., D p k (b).Now that we have a formula for D p k (b), we subtract it to correct Theorem 1 in this case.We consider the cases p ≥ 3 and p = 2 separately.
Case p ≥ 3. From the above argument, we get Case p = 2. Using the above argument, This proves the result.

Consequences of Proposition 1.
Proposition 1 shows that for an odd prime p, positive integer k, and integer b such that b ≡ 1 (mod p), the infinite sequence (C n (b) : n > p k−1 ) when reduced modulo p k is completely determined by its first ϕ(p k ) terms.In this section, we first use this fact to give a characterization of the small prime power factors of C n (b), in particular factors of the form p k such that p k < n.We then discuss its implications to the periodic behavior of C n (b) when reduced modulo positive integers.Proof.First, note that there always exists an r in the range p k−1 < r ≤ p k such that r ≡ n (mod ϕ(p k )), and we can write n = r + tϕ(p k ) for some t ≥ 1. Hence if C r ≡ 0 (mod p k ), then from Theorem 1 we have Conversely, suppose C n (b) ≡ 0 (mod p k ).As in the proof of the Theorem 5, using Fermat's little theorem and Lemma 2, we have b tϕ(p k )/2 ≡ ±1 (mod p k ).The converse is now immediate from Theorem 1.

Periodicity of C n (b) modulo positive integers.
One of the main consequences of Proposition 1 is the following periodic behavior of C n (b) when reduced modulo prime powers.Recall that a sequence (a n : n > q) is antiperiodic with period t if a n+t = −a n for all n > q.In particular, the sequence of number of labeled connected graphs on n vertices; that is, (C n (2) : n ≥ 1) is ultimately periodic modulo every positive integer.
Corollary 1.The infinite sequence (C n (2) : n ≥ 1) is ultimately periodic modulo every positive integer.In other words, it is MC-finite.
Proof.This is trivially true when m = 1.When m ≥ 2 we have gcd(1, m) = 1, and the periodicity in this case follows from Theorem 8.

Conjectures for T n (a, b).
Our results show that the weighted count of labeled connected graphs on n vertices, C n (b) exhibits a simple periodic recurrence when reduced modulo any positive integer that is co-prime to b − 1. Recall that C n (b) is the same as T n (1, b), the Tutte polynomial of the complete graph K n evaluated at (1, b).We computationally verified Proposition 1 for many values of b, p, and k using the recurrence relation to compute T n (a, b) from [8], and also on the numerical data available on the On-line Encyclopedia for Integer Sequences (OEIS) [9, sequence A001187].
Previously, we reported recurrence congruences and periodicity modulo positive integers for the weighted number of labeled forests on n vertices [7].This corresponds to an evaluation of T n (a, b) at the point (a, 1).Further computations suggest that such congruences may be true more widely for evaluations of the Tutte polynomial of K n at other integer points (a, b).More generally, we conjecture the following recurrence congruences for T n (a, b).
A graph G ∈ D.

1 P
(a) A graph G ∈ D.

3. 1 .Theorem 3 .Theorem 4 .Theorem 5 .Theorem 6 .
Small prime power factors of C n (b).Our first two divisibility results are immediate from Proposition 1, and we omit the easy proofs.Let p be an odd prime and let b ≡ 0 (mod p).Then p divides C n (b) for all n > p, and p k divides C n (b) for all n ≥ p k if k ≥ 2. If b is even, then C n (b) is even for all n ≥ 3, is divisible by 4 when n ≥ 5, and is divisible by 2 k when k ≥ 3 and n ≥ 2 k .We next characterize the divisibility of odd prime power factors p k of C n (b) when b (mod p) ∈ {0, 1} and n ≥ p k .We begin with the case n = p k .Let p be an odd prime, let k be a positive integer, and let b (mod p) ∈ {0, 1}.Then p k divides C p k (b) if and only if(i) k = 1 and b ϕ(p)/2 ≡ 1 (mod p) or (ii) k ≥ 2 and p k is a factor of C p k−1 (b).Proof.Theorem 2 implies that if (i) or (ii) were true, then C p k (b) ≡ 0 (mod p k ).The converse when k = 1 is straightforward from Theorem 2. When k ≥ 2, we first note that by Fermat's little theorem b ϕ(p) ≡ 1 (mod p), and thus b ϕ(p)/2 ≡ ±1 (mod p).Hence, by Lemma 2 we also have b ϕ(p k )/2 ≡ ±1 (mod p k ).The converse for k ≥ 2 now also follows from Theorem 2.The next divisibility result is a special case of the periodicity of C n (b) when reduced modulo prime powers p k .Let p be an odd prime, let k, n be positive integers such that n > p k , and let b (mod p) ∈ {0, 1}.Then p k is a factor of C n (b) if and only if p k is a factor of C r (b), where r ≡ n (mod ϕ(p k )) and p k−1 < r ≤ p k .

Theorem 7 .Theorem 8 .
Let p be an odd prime, k ≥ 1, and b (mod p) ∈ {0, 1}.(i) If b ϕ(p)/2 ≡ 1 (mod p), the sequence (C n (b) : n> p k−1 ) is periodic modulo p k with a period t that divides ϕ(p k ).(ii) If b ϕ(p)/2 ≡ −1 (mod p), the sequence (C n (b) : n > p k−1 ) is antiperiodic modulop k with a period t that divides ϕ(p k ).(Consequently, it is periodic with period 2t.)Proof.(i) Since b ϕ(p k )/2 = (b ϕ(p)/2 ) p k−1 , from Lemma 2 we have b ϕ(p k )/2 ≡ 1 (mod p k ).The claim now follows from Theorem 1. (ii) Once again, from Lemma 2 we have b ϕ(p k )/2 ≡ −1 (mod p k ) in this case, and the claim follows from Theorem 1.This periodicity of C n (b) can be extended to modulo positive integers as shown below.Let m ≥ 2 and r ≡ b (mod m) such that 1 ≤ r ≤ m.If r > 1 and gcd(r − 1, m) = 1, then the sequence (C n (b) : n ≥ 1) is ultimately periodic modulo m.Proof.Let m = i=1 p ki i , where the p i 's are distinct primes and k i 's are positive integers.Since r > 1 and gcd(r − 1, m) = 1, we have b ≡ 1 (mod p i ) for each i in the range 1 ≤ i ≤ .If p i = 2 or b ≡ 0 (mod p i ), from Theorem 1 we know that (C n (b) : n ≥ 1) is ultimately periodic modulo p ki i with period 1.Otherwise, from Theorem 7 the sequence (C n (b) : n ≥ 1) is ultimately periodic modulo p ki i .If t i is the period of the sequence reduced modulo p ki i for i ∈ {1, 2, . . ., }, then the Chinese remainder theorem [1, Theorem 5.4] implies that (C n (b) : n ≥ 1) is ultimately periodic modulo m with period lcm(t 1 , t 2 , . . ., t ).