1. Introduction
According to recent terminology (see, e.g., [
1,
2]), a 
C-finite sequence is any sequence defined by a homogeneous linear recurrence relation with constant coefficients. If 
 is a 
C-finite sequence, the recurrence relation is written as follows:
      where 
 are constant with respect to 
n, 
 and 
 is the 
order of the recurrence. The sequence is completely defined when we fix the 
initial conditions, that is, the value of the first 
 elements (not all 0) of the sequence 
. The defining recurrence relation (
1) has the following obvious “generalization”:
      with 
, but obviously the two formulations are equivalent. Therefore, we will always suppose 
.
Surely, C-finite sequences are the simplest and most used numeric sequences, for example, the well-known Fibonacci sequence, the properties of which have been widely studied and applied. Because of that, a number of different representations have been adopted in the literature, often depending on the background of the author and/or on the properties related to the specific application.
Among the various representations, we obviously have recurrence relations which, according to the definition of a 
C-finite sequence, have to be homogeneous, linear and with constant coefficients. For the relation (
1), if 
 is the vector of coefficients and 
 is the vector of initial conditions, we use the following notation:
      where the order can be understood when no ambiguity arises. For the well-known Fibonacci numbers, for example, we have the following:
      valid for every 
, and with 
 as initial conditions.
Another representation is in terms of an explicit formula: a mathematical formula depending on a parameter 
n which returns 
, the element at position 
n in the sequence. Especially important are 
closed formulas, that is, formulas the evaluation of which does not require a number of arithmetic operations depending on 
n. For Fibonacci numbers we have the well-known 
Binet formula:
      where 
 is the golden ratio and 
.
Generating functions correspond to another important representation; it is well known that a sequence 
 is 
C-finite if and only if its generating function is a rational function 
, where 
 are two polynomials having 
. The function 
 contains the whole information relative to the sequence, so it is the ideal approach to most problems relative to 
C-finite sequences. A typical example is the generating function of Fibonacci numbers:
      from which so many properties of Fibonacci numbers can be deduced, in particular the Binet formula.
Moreover, the evaluation of 
 through the recurrence relation can be seen as the computation of some power of a suitable 
matrix. In this case also, the appropriate example is given by the Fibonacci numbers. If we define
      
      then by computing the power 
 we find a matrix containing some elements of the sequence: 
	  The method can be generalized to all 
C-finite sequences and allows many of their properties to be easily proven.
Another peculiar representation is by points: if we know the order 
 of a 
C-finite sequence (or, at least, an upper bound thereof), we can represent it by a subsequence of 
 consecutive elements. In fact, by substituting these values in (
1), we obtain 
 equations in the 
 unknowns 
. If the points belong to the sequence, the system so obtained has one and only one solution. For example, the subsequence 
 defines the Fibonacci numbers, the order of which is 2; from these points, we obtain the following system:
      with the obvious solution 
. This representation has been intensively used by Doron Zeilberger [
2] and known as the method of 
indeterminate coefficients.
The previous and other representations can be found in [
1,
2,
3]. In 
Table 1, we show the first values of some well-known 
C-finite sequences which will be used as examples in this paper; they are found, among others, in the 
On-Line Encyclopedia of Integer Sequences [
4] and we attach a label Axxxxxx to a sequence if it appears in the OEIS with that identifier.
In this work, we aim to introduce a novel representation for 
C-finite sequences, utilizing the framework of 
Riordan arrays, introduced in the literature in [
5,
6] as a generalization of the Pascal triangle.
A Riordan array 
 is defined in terms of two generating functions 
 and 
 with 
, 
, 
 and corresponds to an infinite matrix 
, where the generic element can be found by extracting the coefficient of 
 from the generating function 
 Many properties of Riordan arrays have been studied in the literature; in particular, they are recognized as a powerful tool for proving combinatorial identities (see, e.g., [
6,
7]). Actually, if 
 is any sequence having 
 as its generating function, it can be proven that the computation of the combinatorial sum 
 can be reduced to the extraction of the coefficient from the generating function 
 obtained by transforming 
 in terms of the functions 
 and 
 In this paper, by using an approach based on Riordan arrays, we are able to present a new representation for any 
C-finite sequence, which in the case of Fibonacci numbers gives the following formula:
In 
Section 2, we provide the necessary theoretical foundation for understanding generating functions and Riordan arrays. Subsequently, in 
Section 3, we delve into the connection between 
C-finite sequences and Riordan arrays. A noteworthy feature of the representation discussed in this paper is that it can be generalized to entire classes of 
C-finite sequences of the same order, offering a unified approach to their study. A preliminary version of these results has been presented in [
8].
  2. Generating Functions and Riordan Arrays
One of the most important representations of 
C-finite sequences is through generating functions. Generating functions correspond to one of the most popular approaches to combinatorial problems and a clear exposition of this concept can be found in [
9,
10,
11]. In fact, generating functions belong to the broader framework of the 
method of coefficients (see, e.g., [
12,
13]), which provides a unified approach to handling the algebraic properties of various types of sequences, particularly in the realm of enumerative combinatorics.
Let us consider a sequence of numbers 
; the 
generating function for the sequence 
 is defined as the formal power series 
, where the indeterminate 
t is arbitrary. Given the sequence 
, we introduce the 
generating function operator , which applied to 
 produces the generating function for the sequence, i.e., 
. The operator 
 is clearly linear: 
      and the function 
 can be shifted: 
	  For the Fibonacci sequence 
 we have the following: 
      and by setting 
 we find the following:
	  Because we know that 
, we have the following:
      and by solving in 
 we have the explicit generating function:
Moreover, the notation 
 indicates the extraction of the coefficient of 
 from 
 and is known as the 
coefficient operator, 
 The linearity and shifting properties also apply to the 
 operator:
An important property of this operator is 
Newton’s rule:
      which is one of the most frequently used results in coefficient extraction. Let us remark explicitly that when 
 we have the following:
For example, by using the 
 operator, we can find an explicit expression for Fibonacci numbers. The denominator of 
 can be written as 
 where
      
	  By using partial fraction expansion we find the following:
	  We determine the two constants 
A and 
B by equating the coefficients in the first and last expression for 
:
	  The value of 
 is now obtained by extracting the coefficient of 
:
	  More details and other properties of the operators 
 and 
 can be found in [
13].
The generating functions of C-finite sequences are particularly simple and can be derived directly from their recurrence relation, as previously carried out for Fibonacci numbers.
Theorem 1. A sequence  is C-finite if and only if its generating function  is a rational function:where .  Proof.  The theorem is well known and is sometimes traced back to A. de Moivre [
14], so we limit ourselves to a simple sketch. If 
 is 
C-finite, relation (
1) holds for every 
 and we can apply the rules of the generating function operator linearity and shifting, this latter in the general form
        
        for 
. Multiplying everything by 
 and isolating 
, we obtain 
 where 
 is less than 
 by construction. For the converse, let 
, write this identity as 
 and extract the coefficient of 
:
        
		On the other hand, we have 
, since 
, and this completes the proof.    □
 Some important observations are to be emphasized relative to the conditions of this theorem. First of all, the last recurrence constants 
 and at least one among the initial conditions must be different from 0. In fact, in the former case, 
 would imply an order less than 
; in the latter case, we would obtain the 0 sequence in correspondence of every other specification. Finally, let us consider an example of a generating function for which the condition 
 is not true:
	  Since the denominator is the same as that of Fibonacci numbers, the relation 
 should be valid. However, by a simple inspection, we see that the relation holds true only from the fifth element on, with initial conditions 
 and 
. If we perform the division, we obtain 
 as quotient and 
 as remainder; therefore,
      
      now, everything is clear and we can go on ignoring the first elements, not conforming to the recurrence relation.
A (proper) Riordan array is defined by a pair of generating functions 
 with 
, 
, 
 and the usual way to represent the Riordan array 
 is by means of an infinite matrix 
, its generic element being as follows:
	  If 
, the Riordan array is said to be 
non-proper; moreover, we point out that (
8) is also well defined in the case 
 The Pascal triangle is simply the following case: 
      while
      
      represents the Catalan triangle. The first six rows of the involved matrices are given below: 
	  Both triangles are very well known and studied in the literature.
Many properties of Riordan arrays, in particular their connection with combinatorial sums, have been studied in the literature and are collected in the recent book [
15]. Actually, if 
 is any sequence having 
 as its generating function, it is possible to prove the following:
      thus reducing the sum to the extraction of a coefficient from a formal power series by using the operator 
 (see, e.g., [
6,
7]). Equation (
9) is known as the 
Fundamental Rule of Riordan Arrays (FRRA) and reduces to the partial sum theorem
      
      when
      
      and to the Euler transformation in the case of Pascal triangle:
	  Let us see an application related to Harmonic Numbers 
 starting from the generating function of the sequence 
 
      and the alternate sign version of it: 
	  By using the FRRA, we have
      
      and
      
Equation (
9) can be expressed in a different way, by observing that it corresponds to the product between the matrix 
 and the vector of coefficients 
 For example, the first few rows corresponding to the Euler transformation 
 go as follows: 
	  This reasoning leads to the following formula, which expresses the FRRA in terms of generating functions: 
      where ∗ denotes the action of Riordan arrays on generating functions.
More generally, the product can be performed between two Riordan arrays 
 and 
 as follows: 
	  A key characteristic of proper Riordan arrays is their group structure under the specified product operation. For an in-depth discussion on the theory and practical applications of Riordan arrays, readers can refer to [
15].
  3. Identities for -Finite Sequences
Typically, the FRRA, in both Formulations (
9) and (
10), is applied from left to right, as demonstrated in the examples of the previous section. In this section, however, we introduce a new approach for representing 
C-finite sequences, which involves applying the formula from right to left. Specifically, given the generating function of a 
C-finite sequence of a particular order, the goal is to derive a combinatorial expression for its coefficients through repeated applications of the FRRA. To do so, we consider generating functions of the form 
 with a simple 
t at the numerator.
Let  be the set of all C-finite sequences and  denotes the class of C-finite sequences of order . Every class is, in its turn, subdivided into families, joining all the C-finite sequences having their generating functions with the same denominator. For example, Fibonacci and Lucas numbers belong to the same family, as do Jacobsthal and Jacobsthal–Lucas numbers. Finally, as the representative of the family , we choose the sequence whose numerator is t; this sequence will be called the canonical sequence of its family. The following theorem assures that by studying the canonical sequence we actually study the representation of all the sequences in the family.
Theorem 2. Letbe the generating function of a C-finite sequence of order ω and let  be the generating function of the canonical sequence of the relative family; then,  can be expressed as a linear combination of at most  elements of the canonical sequence.  Proof.  We make use of the method of coefficients by applying linearity and the shifting property 
 whenever 
. Arranging the powers of 
t, we obtain
        
        and 
 is the generating function of the canonical sequence.    □
 We can now concentrate on canonical sequences by introducing some new concepts. Let us begin with the following generating functions:
      and then go on with two families of (non-proper) Riordan arrays: 
	  Moreover, we need the following transformation 
: 
      whose effect consists in pushing down by 
k positions the 
k-th column of the Riordan array. In fact, we have the following lemma:
Lemma 1. Let  be any element of the Riordan array ; then, for any element  of , we have .
 Proof.  Clearly, we obtain the following:
        
□
 The theory of Riordan arrays, with Formula (
10), allows us to prove the following identity.
Theorem 3. For every positive k, we have .
 Proof.  The proof consists in a straightforward computation:
        
        and this is simply 
. We explicitly observe that the computation implies the recursive relation 
    □
 This result has an immediate application. In fact, for 
, we have
      
      the generating function of the generic canonical 
C-finite sequence of order 2. Therefore, we have found a universal formula which can be extended to all 
C-finite sequences of order 2 by means of Theorem 2. The problem is now to find an explicit formula for the elements of the Riordan array 
. Happily, the theory supplies a simple method to find 
:
	  Finally, we compute the following:
      and conclude the following:
Theorem 4. For the canonical sequence of class   we have the following general formula:  Proof.  At this point, the only thing that remains to be proven concerns the limits of the sum. The binomial coefficient is different from 0 when  and . This happens if and only if .    □
 Corollary 1. The following identities hold true. For Fibonacci numbers A000045
, defined by ,For Pell numbers A000129
, defined by ,For Jacobsthal numbers A001045
, defined by ,For  numbers A001047
, defined by ,For n numbers A001477
, defined by ,  In order to find a general formula for class , we proceed in an analogous way.
Lemma 2. With the notations above, we have  Proof.  By applying the rule for the product of two Riordan arrays, we obtain
        
		Finally, 
 pushes down by 
k positions the elements of column 
k, for every 
.    □
 From Lemma 2 and Theorem 3, we find the following:
Theorem 5. For every positive k, we have .
 Varying 
k in Theorem 5, we have the following:
      and so on, thus obtaining decompositions in terms of products of Riordan arrays and generating functions, which easily translate into combinatorial identities.
In particular, let us consider the case , that is, recurrence relations of the third order. For the canonical sequences we have the following:
Theorem 6. For the canonical sequence of class   we have the following general formula:  Proof.  We begin by computing the product 
, the generic element of which is
        
		The next step consists in applying the transformation 
, but, as we have seen, it reduces to the change in variable 
. The last step is to perform the product by 
, which is carried out by applying the fundamental rule of Riordan arrays.    □
 As a simple but meaningful example, we consider Tribonacci numbers A000073
      
      corresponding to the following canonical generating function:
	  The previous theorem gives the following identity: