On $p$-adic valuations of certain $m$ colored $p$-ary partition functions

Let $k\in\N_{\geq 2}$ and for given $m\in\Z\setminus\{0\}$ consider the sequence $(S_{k,m}(n))_{n\in\N}$ defined by the power series expansion $$ \frac{1}{(1-x)^{m}}\prod_{i=0}^{\infty}\frac{1}{(1-x^{k^{i}})^{m}}=\sum_{n=0}^{\infty}S_{k,m}(n)x^{n}. $$ The number $S_{k,m}(n)$ for $m\in\N_{+}$ has a natural combinatorial interpretation: it counts the number of representations of $n$ as sums of powers of $k$, where the part equal to $1$ takes one among $mk$ colors and each part $>1$ takes $m(k-1)$ colors. We concentrate on the case when $k=p\in\mathbb{P}$. Our main result is the computation of the exact value of the $p$-adic valuation of $S_{p,m}(n)$. In particular, in each case the set of values of $\nu_{p}(S_{p,m}(n))$ is finite and the maximum value is bounded by $\op{max}\{\nu_{p}(m)+1,\nu_{p}(m+1)+1\}$. Our results can be seen as a generalization of earlier work of Churchhouse and recent work of Gawron, Miska and Ulas, and the present authors.


Introduction
Theory of partitions is a classical part of number theory. Main arithmetical questions concerning counting functions of various type of partitions are related to divisibility properties and p-adic behaviour for various values of p ∈ P. Particular partition functions are connected with k-ary representations of integers. Let us recall that by a k-ary partition of an integer n we understand the representation of n into powers of k, i.e., the representation of the form where s i ∈ N for i = 0, . . . , u and s 0 ≤ s 1 ≤ . . . ≤ s u . By a colored k-ary representation we understand the k-ary representation, where parts take colors from finite sets. The basic k-ary partition function is related to the case of k = 2. Then, the counting function b(n) of representations of n in the form (1) is called the binary partition function. The sequence (b(n)) n∈N was introduced by Euler, who also noticed the identity The series B satisfies the functional equation (1 − x)B(x) = B(x 2 ). In consequence, by comparing the coefficients near x n on the both sides of the functional relation, we see that the sequence (b(n)) n∈N satisfies: b(0) = b(1) = 1 and b(2n) = b(2n − 1) + b(n), b(2n + 1) = b(2n).
However, it seems that the first non-trivial result concerning the sequence (b(n)) n∈N was obtained by Churchhouse in [4]. In order to state his result, let p ∈ P be given and recall that the p-adic valuation of an integer n, denoted by ν p (n), is just the highest power of p dividing n, i.e., ν p (n) := max{k ∈ N : p k | n} with the convention that ν p (0) = +∞. It is clear that the p-adic valuation satisfies the properties: ν p (n 1 n 2 ) = ν p (n 1 ) + ν p (n 2 ) and ν p (n 1 + n 2 ) ≥ min{ν p (n 1 ), ν p (n 2 )}. Churchhouse proved that the sequence of the 2-adic valuations of (b(n)) n∈N is bounded by 2. More precisely, if n ≥ 2, we have ν 2 (b(n)) = 2 if and only if n or n − 1 can be written in the form 4 r (2u + 1) for some r ∈ N + and u ∈ N. In the remaining cases we have ν 2 (b(n)) = 1. One can observe that we can shortly write where (t n ) n∈N is the Prouhet-Thue-Morse sequence (the PTM sequence for short). The PTM sequence can be defined in many equivalent ways but the most natural in the context of binary partitions is the one through generating functions. More precisely, we have t n x n .
As an immediate consequence of the functional relation T (x) = (1 − x)T (x 2 ) we get the recurrence relations t 0 = 1, t 2n = t n , t 2n+1 = −t n .
The PTM sequence appears in many different areas of mathematics (and even physics). An interesting introduction to the properties of this sequence can be found in [1]. We will encounter this sequence in the sequel one more time.
In the recent paper [7] Gawron, Miska and the first author generalized the result of Churchhouse in the following way. Let m ∈ N + and consider the sequence (b m (n)) n∈N , where The sequence (b m (n)) n∈N has a natural combinatorial interpretation. More precisely, the number b m (n) counts the number of binary representations (1), where each part has one among m colors.
In the cited paper it was proved that the sequence (ν 2 (b m (n))) n∈N , with m = 2 k − 1, k ∈ N + , is bounded by 2 (and independent of k -a rather unexpected result). This result was further generalized for p-ary colored partitions with p ∈ P ≥3 in [11]. Indeed, let A p,m (n) denotes the number of p-ary representations (1) of the number n, where each summand has one among m colors. We proved that for each p ∈ P ≥3 and s ∈ N + , the p-adic valuation of the number A p,(p−1)(p s −1) (n) is equal to 1 for n ≥ p s . We also obtained some results concerning the behaviour of the sequence (ν p (A p,(p−1)(up s −1) (n))) n∈N for fixed u ∈ {2, . . . , p − 1} and p ≥ 3. Let us note that the exponent (p − 1)(p s − 1) for p = 2 reduces to 2 s − 1 considered in [7] (in particular b 2 s −1 (n) = A 2,2 s −1 (n) for all n ∈ N). This shows striking difference in behaviour of the p-adic valuations of A p,(p−1)(p s −1) (n) between the case of p = 2 and p ∈ P ≥3 . In the light of the cited results a natural question arises whether there is a p-ary partition type function such that its colored version has a bounded p-adic valuation for each fixed number of colors (not only of particular forms like in the cases considered in [7,11]). The aim of this paper is to present such a function and obtain exact expression for the corresponding sequence of p-adic valuations.
For k ∈ N ≥2 we consider the power series expansion Then, for m ∈ Z \ {0} we consider the power series S k,m (n)x n , and the sequence (S k,m (n)) n∈N . Similarly, as in the previous cases the coefficient S k,m (n) for m ∈ N + , has a natural combinatorial interpretation. The number S k,m (n) counts the number of k-ary representations (1), such that the part equal to 1 takes one among km colors and each part > 1 takes one among (k −1)m colors. In the paper we are concentrate on the case k = p ∈ P. As we will see, it is possible to compute the expression for ν p (S p,m (n)) for each p ∈ P, n ∈ N and m ∈ Z, explicitly. Let us note that in the case m < 0 we are working with the sequence with varying signs and it is a non-trivial question whether the number S p,m (n) can be zero. Unexpectedly, we will show that this is not the case. This non-obvious observation will be consequence of our main results. We should also mention that as in previous works the case of p = 2 and p ∈ P ≥3 are quite different. Thus, we introduce the following definitions with the aim to simplify the notation a bit. More precisely, we write c m (n) := S 2,m (n), d m (n) := S p,m (n) for fixed p ∈ P ≥3 .
Let us note that we have the equality c 1 (n) = b(2n) which is a consequence of the equalities We are in position to state the content of the paper in some details.
In Section 2 we consider the case p = 2 and obtain the closed formula for ν 2 (c m (n)) for any given m ∈ Z. The formula is stated in Theorem 2.4 and implies that ν 2 (c m (n)) is constant for even m and positive n. In the case of odd m the value of ν 2 (c m (n)) is equal to 1 or ν 2 (m + 1) + 1, depending on whether t n = t n−1 or t n = t n−1 , respectively.
The next two sections are devoted to the proof of the equality ν p (d m (n)) = ν p (m) + 1 which holds for n ∈ N + and each m ∈ Z \ {0} (Theorem 3.5 and Theorem 3.7). According to our best knowledge our results are the first concerning the exact computation of the p-adic valuations of m colored partitions (with non-rational generating function of course). Moreover, our results can be seen as natural generalizations of Churchhouse result. As a by-product of the employed methods we also get an unexpected fact that the sequence dm(n) pm (mod p) n∈N+ is independent on m.
Thus, a more detailed analysis of this sequence is performed in Section 4. The main result of this section is the proof of p-automaticity of the sequence dm(n) pm (mod p) n∈N+ (Theorem 4.1) and transcendence of the corresponding ordinary generating function (Theorem 4.6).
In Section 5 we present study of the p-adic behaviour of the difference d m (pn) − d m (n). In particular we prove sufficient conditions for the inequality ν p (d m (pn) − d m (n)) ≥ ν p (m) + 3 to hold (Theorem 5.5).
Finally, in the last section we ask for a possible generalization of our results, present effects of some numerical computations and formulate some questions, problems and conjectures.

The case of p = 2
In order to simplify the notation a bit let us put Let us observe the power series C(x) satisfies the functional relation (1 − x)C(x) = (1 + x)C(x 2 ) . In consequence, for m ∈ Z we have the relation which will be useful in the proof of Lemma 2.2 below. Moreover, in the sequel we will need the following functional property: for m 1 , m 2 ∈ Z we have We start our investigations with a simple lemma which is a consequence of the result of Churchhouse and the product form of the series C −1 (x). Lemma 2.1. For n ∈ N + , we have the following equalities: Proof. The first equality is an immediate consequence of the equalities c 1 (n) = b(2n), ν 2 (b(n)) = 1 2 |t n − 2t n−1 + t n−2 | and the recurrence relations satisfied by the PTM sequence (t n ) n∈N , i.e., t 2n = t n , t 2n+1 = −t n . The second equality comes from the expansion In order to compute the 2-adic valuations of the sequence (c ±2 (n)) n∈N we need the following simple Lemma 2.2. The sequences (c ±2 (n)) n∈N satisfy the following recurrence relations: c ±2 (0) = 1, c ±2 (1) = ±4 and for n ≥ 1 we have Proof. The recurrence relations for the sequence (c ±2 (n)) n∈N are immediate consequence of the , which can be rewritten in an equivalent form . Comparing now the coefficients on both sides of this relation we get the result.
Proof. The proof relies on a simple induction. Indeed, we have c ±2 (1) = ±4, c −2 (2) = 4, c 2 (2) = 12 and thus our statement folds for n = 1, 2. Assuming it holds for all integers ≤ n and applying the recurrence relations given in Lemma 2.2 we get the result.
The second part is an immediate consequence of the obtained congruence.
Proof. First of all, let us note that our theorem is true for m = 1, ±2. This is a consequence of Lemma 2.1 and Corollary 2.3. Let m ∈ Z and |m| > 2. Because c m (0) = 1 and c m (1) = 2m, our statement is clearly true for n = 0, 1. We can assume that n ≥ 2.
We are ready to prove the general result. At first, we prove it for even numbers m. We proceed by induction on |m|. As we have already proved, our theorem is true for m = ±2. Let us assume that it is true for each m satisfying |m| < 2M . Let |m| = 2M and write m = 4k + r for some k ∈ Z and r ∈ {0, 2}.
Thus we can conclude, that the statement is true for all even numbers m. We go to odd ones. We have already showed the theorem for m = −1 and m = −3. Similarly as before, let us write m = 4k + r for some k ∈ Z and r ∈ {1, 3}.
The explicit form of the value of ν 2 (c m (n)) for m odd allow us to prove the following.
Proof. Let us observe that the necessary condition for the inequality ν 2 (c m (2n) − c m (n)) > 1 to hold is the condition However, if t n = t n−1 , then t n = −t n−1 and thus t 2n − t 2n−1 = t n + t n−1 = 0. Similarly, the equality t n = t n−1 implies that t n + t n−1 = 2t n and thus t 2n − t 2n−1 = 2t n = 0. In other words, if ν 2 (c m (n)) = 1 then ν 2 (c m (2n)) > 1 and vice versa. In consequence we have the equality ν 2 (c m (2n) − c m (n)) = 1 and get the result.
Let us observe that the sequence (ν 2 (c m (n))) n∈N (for m odd) can be seen alternatively as a solution of the recurrence relation: w m (0) = 0, w m (1) = 1, w m (2) = ν 2 (m + 1) + 1 and w m (2n + 1) = 1, w m (4n) = w m (n), w m (4n + 2) = ν 2 (m + 1) + 1. The above recurrence is an immediate consequence of our explicit formula given in Theorem 2.4. We use it in order to show that the sequence (ν 2 (c m (n))) n∈N is 2-automatic. However, before we do this we need to recall the notion of a k-automatic sequence. More precisely, let k ∈ N ≥2 be given. We say that the sequence ε = (ε n ) n∈N is k-automatic if and only if the following set called the k-kernel of ε, is finite. If the k-kernel of the sequence ε is infinite but finitely generated then we say that our sequence is k-regular.
Let us also recall that one of equivalent conditions for automaticity, is the following result of Christol: let p ∈ P and q be a power of p, and a = (a n ) n∈N be a sequence over F q . Then a is p-automatic if and only if the formal power series ∞ n=0 a n x n is algebraic over F q (x). The proof can be found in [3] or in recent monograph [1,Theorem 12.2.5].
Proof. The result is obvious if m is even, because in this case the sequence is ultimately constant by Theorem 2.4. Let us assume that m is odd and denotec m (n) := ν 2 (c m (n)) for n ∈ N, and C m (x) := ∞ n=0c m (n)x n . Theorem 2.4 and the remark given above imply the relations: soC m (x) is algebraic over F 2 (x) and the result follows from Christol's Theorem.
It is worth to note, that a sequence is k-automatic if and only if there exists an automaton for it. Roughly speaking, automaton is a procedure that allow us to compute for each n ∈ N the n-th member of a sequence by using only the digits in the (unique) representation of n in the base k. For more precise definition see [2]. We can either use the convention to read the digits of the base-k representation of n from the highest power of k that appear in the representation to the lowest one (that is, from the right to the left), or conversely, that is, from the lowest (i.e., from the 0'th power) to the highest one (that is, from the left to the right). It is known, that a given sequence is k-automatic in the first convention if and only if it is k-automatic in the second one, but automatons may be different depending on the convention.
We can present automatons generating the sequence (ν p (c m (n))) n∈N+ in both conventions. In the case of even m it is very simple. For odd m, they are presented below.  . Automaton generating (ν 2 (c m (n))) n∈N+ for odd m when reading digits of n from the right to the left.
Remark 2.8. The second automaton is very similar to the one generating so called period-doubling sequence given by e n = ν 2 (n + 1) (mod 2) for n ∈ N. This sequence was considered for example in [5]. This similarity is not a coincidence, because the period-doubling sequence can be defined also as the sequence e n = 1 − (s 2 (n) − s 2 (n − 1)) (mod 2), where s 2 (n) is the number of 1's in the unique binary expansion of n. On the other hand, the value of the quantity ν 2 (c m (n)) depends on the difference t n − t n−1 and hence, because of the equality t n = (−1) s2(n) , on the difference s n − s n−1 .
From the above discussion one can observe, that e n = 1 if and only if t n = t n−1 . Thus, Theorem 2.4 for odd m can be rewritten as for all n ≥ 1.
Proof. From our description of the 2-adic valuation of c m (n) given in Theorem 2.4, we see that ν 2 (c m (n)) = +∞ for n ∈ N. This is equivalent with the non-vanishing of c m (n) for n ∈ N and hence the result.
Let us recall that in [7] the sequence (t m (n)) n∈N , m ∈ N + , was investigated. Here t m (n) is the Cauchy convolution of m-copies of the PTM sequence, i.e., We characterized the solutions of the equation t 3 (n) = 0 in terms of the expansion of n in base 4. In particular, the equation t 3 (n) = 0 has infinitely many solutions. Moreover, t m (n) = 0 for m being power of 2. We also conjectured the non-vanishing of t m (n) for m = 3 but we were unable to prove such a statement. Thus, the above corollary also shows strong difference of the sequences (t m (n)) n∈N and (c −m (n)) n∈N for m ∈ N + .
The result obtained in Theorem 2.4 can be also used to prove the following Corollary 2.10. Let m ∈ N + and U m (n) denotes the number of binary partitions of n such the part equal to 1 takes one among 2m + 1 colors and parts > 1 take one among m colors. Then Proof. From the definition of U m (n) we immediately deduce that U m (n) = n i=0 c m (i). Because c m (0) = 1 and from Theorem 2.4 we know that c m (n) ≡ 0 (mod 2) for n ∈ N + , we get that C m (n) is odd for n ∈ N.
3. The case of p ∈ P ≥3 Let p ∈ P ≥3 be fixed. In this section we are interested in the computation of the exact formula for the p-adic valuations of the elements of the sequence (d m (n)) n∈N , where and m ∈ Z \ {0} is fixed. Because p is fixed in the sequel in order to simplify the notation a bit we introduce the quantity: Let us recall that the number d m (n) counts the number of p-ary representations of n, where each part > 1 can take (p−1)m colors and additionally the part equal to 1 can take pm colors. Moreover, in the sequel we will frequently use the following notation: where A is given logical formula.
We start with the proof of recurrence relations satisfied by the sequence (d m (n)) n∈N for m ∈ N + .
Lemma 3.1. Let m ∈ N + . Then d m (0) = 1 and for n ≥ 1 we have the following recurrence relation Proof. In order to get the result it is enough to note the functional identity Indeed, we have the following equalities Comparing now the coefficients near x n on both sides we see that if p ∤ n, then and if p | n, then we have Solving for d m (n) we get the result.
In the sequel we will heavily use the notion of congruences between power series. More precisely, let f (x) = ∞ n=0 a n x n and g(x) = ∞ n=0 b n x n are formal power series with coefficients in Z and M ∈ N ≥2 be given. We say that f, g are congruent modulo M if and only if for all n the coefficients of x n in both series are congruent modulo M . In other words It is an easy exercise to prove that for any given f, , then the series for 1/f and 1/g have integer coefficients and then 1 Now we are ready to state the following.
for all n ≥ 1.
Therefore, the only coefficient of the series H m (x) not divisible by p α+1 is d m (0) = 1.
for all n ≥ 1.
Proof. We use the induction argument. For n = 1 we have by Lemma 3.1: Let us assume that the statement is true for all numbers less than some number n. We want to prove it for n. Lemma 3.1 implies In the above computations we used the induction hypothesis, Lemma 3.2 and the congruence pm pi ≡ m i (mod p) which is a consequence of Lucas theorem. The result follows.
Proof. Let n ∈ N + and assume that p ∤ n. Then Lemma 3.1 implies the equality If p ∤ i then p| pm i , and by Lemma 3.2 we get the divisibility property p α+1 |d m,p (n − i) which holds for n > i . Therefore, if n < pm, then the only term in the above sum that may not be divisible by p α+2 is the one corresponding to i = n, i.e., (−1) n+1 pm n d m,p (0) = (−1) n+1 pm n . Similarly, if n > pm, then the only such term can be the one corresponding to i = pm, i.e., (−1) pm+1 pm pm d m (n − pm) = d m (n − pm). Now we are ready to prove the following general result concerning the expression of ν p (d m (n)) for m ∈ N + . Theorem 3.5. Let p ∈ P ≥3 and m ∈ N. Let n ∈ N ≥1 and n = n s p s + . . . + n t p t be (the unique) representation of n in base p. Here s ≤ t and n s = 0. Then d m (n) ≡ pm n −1 s (mod p) (mod p νp(m)+2 ).
In particular, Proof. At the beginning observe, that for each m we have d m (0) = 1, so ν p (d m (0)) = 0. Let us assume that n ≥ 1 and m = p α for some α ≥ 0. By Lemma 3.2 it is reasonable to consider the sequence a α = (a α (n)) n∈N+ of elements of Z/pZ, where a α (n) := d m (n) p α+1 (mod p). Lemmas 3.3 and 3.4 imply the following recurrence relations: if n > p α+1 and p ∤ n, a α (pn) = a α (n).
Observe, that if n < p α+1 and p ∤ n then Thus a α (n) = 1 n (mod p) for n < p α+1 such that p ∤ n. If n is arbitrary, then recurrence relations for a α (n) imply Write n = n s p s + . . . + n t p t , s ≤ t, n s > 0. If m = p α k, where k ∈ N + and p ∤ k, then We note that, if at least two numbers among a 1 , . . . , a k are non-zero, then by Lemma 3.2 we get d p α (a 1 ) · . . . · d p α (a k ) ≡ 0 (mod p α+2 ). Hence, the expression d p α (a 1 ) · . . . · d p α (a k ) may not be divisible by p α+2 only if a j = n for some j and a i = 0 for all i = j. Thus and our result follows.
One can ask, whether it is possible to give a theorem similar to Theorem 3.5 but for negative integers m? In order to give an answer, let us introduce the sequence (D p (n)) ∞ n=1 defined as Observe, that Therefore, d −1 (n) = D p (n) − D p (n − 1) for n ≥ 1, and d −1 (0) = 1. From [11, Lemma 2.3] we get the equality ν p (d −1 (n)) = 0, if n = 0, 1, if n ≥ 1. We will also need the following simple fact.
We are ready to prove the following analogue of Theorem 3.5.
In particular, Proof. Firstly, we prove the result for m = p α . Observe, that because d −1 (0) = 1. From Lemma 3.6 we have for i ≥ 2: Therefore, Hence, the result is true when m is a power of p or m = 1. If m = p α k, where p ∤ k, then similarly as in the proof of Theorem 3.5 we get: The result follows. Proof. From our description of the p-adic valuation of d m (n) given in Theorem 3.7, we see that ν p (d m (n)) = +∞ for n ∈ N. This is equivalent with the non-vanishing of d m (n) for n ∈ N and hence the result.
As a very surprising corollary from Theorems 3.5 and 3.7 we get the next fact. In this section we will study the sequences (y p (n)) n∈N+ , (z p (n)) n∈N+ more closely. In particular we prove p-automaticity of our sequences. Let i.e., Y p and Z p are the generating functions of the sequences (y p (n)) n∈N+ and (z p (n)) n∈N+ , respectively. Now we are ready to state the main result of this section.
Proof. By Christol's Theorem, it is enough to show, that Y p and Z p are both algebraic over F p (x). First we consider the series Y p . Let us denote In the proof of Theorem 3.5 it was shown, that the sequence (y p (n)) ∞ n=1 satisfies the following recurrence relations:    y p (n) = n −1 (mod p), if 1 ≤ n ≤ p − 1, y p (n) = y p (n (mod p)), if p ∤ n, y p (pn) = y p (n). Therefore, so Y p is indeed algebraic over F p (x).
For the proof of the case of the sequence Z p , notice the following relations: The last congruence follows from the fact that z p (n) ≡ d−1(n) p (mod p). Thus (we consider the equalities below as equalities over F p , i.e., modulo p) We can write the equation for Z p in an equivalent form as so Z p is also algebraic over F p (x).
The explicit form of the equations satisfied by Y p and Z p allow us to show the strong relation between sequences (y p (n)) n∈N+ and (z p (n)) n∈N+ .

Proof. Summing equations (3) and (4) we get
Because the 0th term in the second factor is not divisible by p we need to have Y p (x) + Z p (x) ≡ 0 (mod p), and this is equivalent to the statement.
In the case of sequences (y p (n)) n∈N+ and (z p (n)) n∈N+ we can write the automatons down in both conventions (recall the discussion on the end of Section 2). Now we show them for the first of these sequences. In the case of the second one, it is enough to switch n −1 into −n −1 for all n = 1, . . . , p − 1. The automaton generating (y p (n)) n∈N+ when we read digits from the left to the right is presented below.   On the other side, if we read the digits in the opposite direction we present the corresponding automaton generating (y p (n)) n∈N below.  Let us note that in the case p ≥ 3 the sequence (ν p (d m (n))) n∈N is p-automatic, which is an immediate consequence of the fact that it is ultimately constant.  In particular, Proof. The first part follows from Theorems 3.5 and 3.7, and Corollary 4.2. Indeed, The second part is now an immediate consequence of Lemma 3.3.
We group the fact above, Theorems 3.5 and 3.7, and Corollary 3.9 and simply get the following general result. In particular, does not depend on m.
We can apply Corollary 4.4 to the problem that was considered in [11]. Let us define for p ∈ P ≥3 , m ∈ N ≥1 a sequence (A p,m (n)) n∈N as The number A p,m (n) counts the number of p-ary representations of n such that each part takes one among m colors. The sequence (A p,m (n)) n∈N was thorough studied in [11]. One of main results of the cited paper states that for each α ∈ N ≥1 and n ≥ p α the following equality holds: Using our previous findings we are able to improve the above equality to the following Theorem 4.5. Let p ∈ P ≥3 , α ∈ N ≥1 and n ≥ p α . Let n = t j=s n j p j , where s ≤ t and n s = 0, be the base-p representation of n. Then . Proof. The relation on the very end of the proof of Theorem 3.1 from [11] implies that (we assume that n j = 0 for j < s). Corollary 4.4 gives For the end of the proof it is enough to observe that for each j ∈ {0, . . . , α − 1}: We finish this section with the following Proof. Because y p (n), z p (n) ∈ {1, . . . , p−1} (treated as elements in Z), then it is clear that the series Y p (x) and Z p (x) are absolutely convergent in the set {x ∈ C : |x| < 1} and thus define analytic functions. From Corollary 4.2 and the fact that 0 < y p (n), z p (n) < p, we get that z p (n) = p − y p (n) for all n ∈ N + . Thus simply Therefore, in order to get the transcendence of the functions Y p (x) and Z p (x), it is enough to prove it only for Y p (x).
In the proof of Theorem 4.1 we obtained the functional equation for the function Y p (x): This equation was proved in fact over C, not only over F p (because all equalities in this case were 'true' equalities, i.e., not equalities modulo p).
The transcendence of Y p will be consequence of a general result of Nishioka [9]. This result says that a power series, say f , with rational coefficients, which defines an analytic function in some neighborhood of zero and satisfying functional equation of the form f (x) = A(x) + B(x)f (x m ) for some m ∈ N ≥2 and functions A, B ∈ C(x), is either rational of transcendental. In the light of this remark we see, that in order to get transcendence of Y p it is enough to prove that our function is not rational.
Let us suppose that Y p (x) is rational, i.e., Y p (x) = P (x)/Q(x) for some P, Q ∈ C[x] with gcd(P (x), Q(x)) = 1. Putting the expression for Y p into the functional equation and clearing the denominators we get the equation: From the above equation we get Q(x p ) | (1 − x p )x p−1 P (x p )Q(x). However, the co-primality of the polynomials P (x), Q(x) implies co-primality of the polynomials P (x p ), Q(x p ) and thus we get Consequently p deg Q ≤ 2p − 1 + deg Q and thus deg Q ≤ 2 + 1 p−1 . We thus see that the degree of the polynomial Q is bounded by 2.
Let us put x = 1 in (5). We get that Q(1) 2 W p (1) = 0, but W p (1) > 0, so Q(1) = 0. In particular, deg Q ≥ 1 and we can write Q(x) = (1 − x)S(x). Plug it into (5) and get after dividing by 1 − x: If deg Q = 1, then S is a constant, say S(x) = S 0 = 0. Equation (6) implies: Observe, that deg W p (x) = p − 2. If deg P ≥ 1, then the degree of the polynomial of the right hand side of the last equation is equal to deg(x p−1 P (x p )) ≥ 2p − 1 > p − 2, a contradiction. Hence, deg P = 0, so we can write P (x) = P 0 = 0. Then we get from the last equation: that is again a contradiction, since not all coefficients of W p (x) are equal to each other. Thus we may assume that deg Q = 2 and deg S = 1.
, and by comparing the degrees we get deg T = 0. Comparing the coefficients near x p−1 implies S 0 = 0, i.e., S(x) = S 1 x. Equation (6) implies: If deg P ≥ 2, then deg 1 S1x that is a contradiction. Summing up our discussion: we proved that there are no polynomials P, Q ∈ C[x] satisfying the equation (5) and thus the function Y p (x) can not be rational.
Remark 4.7. In the above proof, instead of use result of Nishioka, we could use classical result of Fatou: if a power series ∞ n=0 a n x n with integer coefficients converges inside the unit disk, then it is either rational or transcendental over C(x) [6]. However, it is clear that the burden of the proof lies in the proof of irrationality of Y p (x).
An immediate consequence of our result is the following.
Proof. It is clear that the ordinary generating function of a periodic sequence is rational. However, in the theorem above we proved that the ordinary generating functions of our sequences are transcendental.
Remark 4.9. One can investigate further properties of the sequence (y p (n)) n∈N+ . We note only one property. More precisely, one can easily prove the following summation formula

5.
Further congruences for d m (pn) − d m (n) Observe, that Theorem 3.5 can be viewed as a generalization of Lemma 3.2. Therefore, it is natural to use this more general fact in order to generalize some of results that we have previously obtained. In the sequel, we will need the following lemma, that is a generalization of Wolstenholme's theorem [12], which says, that for p ∈ P ≥5 the following congruence holds The Wolstenholme's theorem is equivalent to the following pair of the congruences that will be used in the proof.

Hence, indeed
We can repeat the proof of the previous fact and get result modulo p νp(m)+νp(m−1)+3−χ . Observe, that at most one of the number ν p (m) and ν p (m − 1) may be non-zero. Hence, if ν p (m − 1) = 0, we can still apply Lemma 5.3 that is better in this case. Finally, we get However, we will not need this fact later.
Proof. We prove only the case p ≥ 5. If p = 3, the proof is analogous and in fact simpler because of some additional cancellations. Let us write m = p α k, where p ∤ k. For n = 1 we have By Lemma 5.1 we get that p 2α+3 | pm p − m. Moreover, and using Theorem 3.5 we obtain the congruence Thus always d m (p) ≡ d m (1) (mod p 2α+3 ), i.e., ϑ m (1) ≡ 0 (mod p 2α+3 ). Now assume, that n is arbitrary. The recurrence relation for d m (n) gives At first, we deal with Σ 1 . Observe, that if i = δp + γ for some δ ∈ N and γ ∈ {1, . . . , p − 1}, then Hence, Now we focus on Σ 2 . We can write: ϑ m (n)x n be the generating function of the sequence (ϑ m (n)) ∞ n=0 . Lemma 5.3 can be restated in the following way: Equivalently, due to the identity we get the congruence Observe, that we can also rewrite the above functional equation for Θ m as Thus simply: for all n ≥ 1.
Lemma 5.3 allow us to simply get the following theorem concerning the problem of finding natural numbers k such that the congruence d m (pn) ≡ d m (n) (mod p νp(m)+k ) holds for all n ≥ 1.

Questions, problems and conjectures
In this section we collect some questions, problems and conjectures which appeared during our work.
It is well known that if k ∈ N + and t ≡ 1 (mod 2), then where b(n) counts the binary partitions of n). The above congruences were conjectured by Churchhouse in [4] and independently proved by Rödseth [10] and Gupta [8]. Moreover, it is known that there is no higher power of 2 which divides c 1 (4n)− c 1 (n). These results generated a lot of research devoted to certain differences connected with other partition functions. This result motivates the question concerning the divisibility of the number c m (2 k+2 n) − c m (2 k n) by powers of 2. We performed some numerical computations in case of m ∈ {2, 3, . . . , 10} and n ≤ 10 5 and believe that the following is true. Conjecture 6.1. For k ∈ N + and each n ∈ N + , we have: ν 2 (c 2k (4n) − c 2k (n)) = ν 2 (n) + 2ν 2 (k) + 3.
In each case the equality holds for infinitely many n ∈ N.
In case of p ∈ P ≥3 we can use Theorem 5.5 to get some information about the behaviour of the differences d m (p 2 n) − d m (n) modulo powers of p. However, we predict that results obtained in this way are far from being optimal. For example, a direct application of Theorem 5.5 gives On the other hand, we believe that the following, much stronger property, is true. Conjecture 6.2. Assume that m = pk + i for some k ∈ N and i ∈ {0, . . . , p − 1}. Then we have the following equality: In the case i = p − 1 the following inequality is true: For infinitely many values of n the above inequality is an equality.
In the light of results obtained in the previous section it is quite natural to ask about existence of pairs m ∈ N + and k ∈ N ≥3 such that the following congruence holds. We performed numerical search for values of m ∈ {2, . . . , 100} such that the congruence (7) is satisfied for k = 5 or k = 6, p ∈ {3, 5, . . . , 29} and all n ≤ 10 3 . For k = 5 we found the following pairs Among the above pairs only the pairs (p, m) = (3, 80), (3,81) extend to solutions of (7) with k = 6. We formulate the following general Problem 6.3. For which triples (p, m, k) ∈ P ≥3 × N + × N ≥3 the congruence (7) holds for all n ∈ N + ?
Let p ∈ P and for n ∈ N + write n = k i=0 ε i p i , where ε i ∈ {0, 1, . . . , p − 1} and k ≤ log p n. This representation is just the (unique) p-ary expansion of n in base p. Let us observe that the equality ν p (n) = u implies ε 0 = . . . = ε u−1 = 0 and ε u = 0 in the above representation. Thus, if m ∈ Z\{−1} is fixed, our results concerning the exact value of ν 2 (c m (n)) and ν p (d m (n)) for p ∈ P ≥3 given in Theorem 2.4 and Theorems 3.5 and 3.7 respectively, imply that the set of values of the numbers of trailing zeros in the binary expansion of c m (n) and p-ary expansion of d m (n)), n ∈ N + , is bounded. This observation suggests the question whether the index of the next non-zero digit in the binary expansion in c m (n) or p-ary expansion of d m (n) is in bounded distance from the first one. We state this in equivalent form as the following Question 6.4. Let m ∈ N + and write u m (n) = ν 2 c m (n) 2 ν2(cm(n)) − 1 , v p,m (n) = ν p d m (n) p νp(dm(n)) − d m (n) p νp(dm(n)) (mod p) , where p ∈ P ≥3 . Does there exist m ∈ N + such that some of the sequences (u m (n)) n∈N+ , (v p,m (n)) n∈N+ has finite set of values?
In order to see what is going on, we performed numerical computations for m ∈ {1, . . . , 100} and n ≤ 10 5 . We observed that in the considered range there are many values of m such that the set of values of the sequence (u m (n)) n∈N is small (we looked for sets with cardinality ≤ 4). We   Table 1. Values of m ∈ {1, . . . , 100} such that L m (10 5 ) ≤ 4 together with the largest value of u m (n) for n ≤ 10 5 .
Our numerical computations strongly suggest that there should be infinitely many m ∈ Z such that the sequence (u m (n)) n∈N is bounded. We even dare to formulate the following Conjecture 6.5. Let k ∈ N + and m = 2 2k − 1. Then the sequence (u m (n)) n∈N is bounded.
In fact, we expect that for n ∈ N the inequality u 2 2k −1 (n) ≤ 2k is true. In case of p ∈ P ≥3 we expect that for all m ∈ N + the sequence (v p,m (n)) n∈N+ is unbounded.
Finally, let us note that in earlier sections we proved results concerning the p-adic behaviour of the sequence (d m (n)) n∈N with p ∈ P and m ∈ Z \ {0}. A first question which comes to mind is whether anything similar can be proved for the sequence (S k,m (n)) n∈N , where k is not a prime number. Here we back to our general definition of S k,m (n) as the n-th coefficient in the power series expansion of H k,m (x). We thus ask about the behaviour of ϕ k (S k,m (n)), where ϕ k : N → N is an analogue of the p-adic valuation function, i.e., for given n ∈ N we define ϕ k (n) := max{s ∈ N : k s | n} and ϕ k (0) := +∞. It is clear that if k ∈ P, then the function ϕ k is not additive. Indeed, if k = k 1 k 2 with k 1 , k 2 > 1 and n 1 = k 1 u 1 , n 2 = k 2 u 2 with gcd(u 1 u 2 , k) = 1, then ϕ k (n 1 n 2 ) = 1 = ϕ k (n 1 ) + ϕ k (n 2 ) = 0. However, the question concerning the behaviour of the sequence (ϕ k (S m,k (n)) n∈N is still interesting and non-trivial. Moreover, it seems that in the case of composite k some new phenomena arise. We concentrate on the first non-trivial case, i.e., k = 4, and formulate several conjectures. Conjecture 6.6.
Our numerical calculations suggest that for k = p a and m = p b , a, b ∈ N + , the sequence of the p-adic valuations of S k,m (n) is p-automatic (and thus bounded). However, we were unable to formulate such nice formula for the corresponding valuation like in the case k = 4 and m = 2 s . Anyway one can state the following general Problem 6.7. For given k = p a , where p ∈ P and a ∈ N + characterize those values of m ∈ N + such that the sequence (ν p (S k,m (n))) n∈N is p-automatic (is bounded).
Numerical computations suggest the following Conjecture 6.8.
(1) If k is not a power of a prime number, then for each m ∈ N + the sequence (ϕ k (S k,m (n))) n∈N is unbounded.
(2) If k is not a power of a prime number, then for each m ∈ N + the sequence (ϕ k (S k,m (n))) n∈N is not k-regular.