\documentclass[12pt,reqno]{article}

\usepackage[usenames]{color}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{amscd}
\usepackage{graphicx}

\usepackage[colorlinks=true,
linkcolor=webgreen,
filecolor=webbrown,
citecolor=webgreen]{hyperref}

\definecolor{webgreen}{rgb}{0,.5,0}
\definecolor{webbrown}{rgb}{.6,0,0}

\usepackage{color}
\usepackage{fullpage}
\usepackage{float}

\usepackage{psfig}
\usepackage{graphics}
\usepackage{latexsym}
\usepackage{epsf}
\usepackage{breakurl}

\setlength{\textwidth}{6.5in}
\setlength{\oddsidemargin}{.1in}
\setlength{\evensidemargin}{.1in}
\setlength{\topmargin}{-.1in}
\setlength{\textheight}{8.4in}

\newcommand{\seqnum}[1]{\href{https://oeis.org/#1}{\rm \underline{#1}}}

\usepackage[noabbrev,capitalise]{cleveref}
\usepackage{mathrsfs}
\usepackage{booktabs}


\begin{document}

\begin{center}
\epsfxsize=4in
\leavevmode\epsffile{logo129.eps}
\end{center}

\theoremstyle{plain}
\newtheorem{theorem}{Theorem}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}

\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}
\newtheorem{conjecture}[theorem]{Conjecture}

\theoremstyle{remark}
\newtheorem{remark}[theorem]{Remark}

\begin{center}
    \vskip 1cm{\LARGE\bf  
    An Explicit Formula for \\
    Supergeneralized Leonardo $p$-numbers \\}
    \vskip 1cm
    \large
    Clemens Sch\"utz and Kristian Kelly \\ 
    Department of Mathematics\\
    University of Vienna\\
    Vienna \\
    Austria \\
    \href{mailto:schuetzc48@univie.ac.at }{\tt schuetzc48@univie.ac.at}\\
    \href{mailto:kristiank22@univie.ac.at}{\tt kristiank22@univie.ac.at}
\end{center}

\vskip .2 in
\begin{abstract}
In this paper, we introduce the supergeneralized Leonardo $p$-numbers, $\mathcal{L}_{p,k,\mathbf{x}}(n)$, which extend the definition of the generalized Leonardo $p$-numbers, introduced by Kuhapatanakul and Ruankong, by not requiring $\mathcal{L}_{p,k}(0) = \cdots = \mathcal{L}_{p,k}(p) = 1$ but allowing the first $p+1$ initial values to be chosen freely.
We then investigate the structure of these sequences, show that they are related to the Fibonacci $p$-numbers, and provide an explicit formula for $\mathcal{L}_{p,k,\mathbf{x}}(n)$ when $n > p$.
\end{abstract}

\newcommand{\?}{\overset{?}{=}}

\makeatother

\newcommand{\R}{{\mathbb R}}
\newcommand{\Q}{{\mathbb Q}}
\newcommand{\C}{{\mathbb C}}
\newcommand{\N}{{\mathbb N}}
\newcommand{\Z}{{\mathbb Z}}
\newcommand{\iu}{{i\mkern1mu}}
\newcommand{\minus}{\scalebox{0.75}[1.0]{$-$}}
\newcommand{\Mod}[1]{\ (\mathrm{mod}\ #1)}

\newcommand\equ[1]{\begin{equation} #1 \end{equation}}

\newcommand{\helv}{%
  \fontfamily{phv}\fontseries{m}\fontsize{9}{11}\selectfont}


\section{Introduction}

There are few sequences more well-known in popular culture than the Fibonacci numbers, which are defined by $F_0 = 0$, $F_1 = 1$ and $F_{n + 1} = F_{n} + F_{n - 1}$ when $n \geq 1$.  These numbers appear as sequence
\seqnum{A000045} in the {\it On-Line Encyclopedia of Integer Sequences} (OEIS) \cite{OEIS2025}.
They are well-known due to their age, interesting mathematical properties and the occurrences of the golden ratio $\phi = \lim_{n \to \infty}\frac{F_{n+1}}{F_n}$ in nature or music (cf.\ \cite[p.~371]{inigo2019college} and \cite{fibmusic}).
This raises the question: Do generalizations of the Fibonacci sequence have even more hidden patterns?
This issue has been extensively researched.
Examples of generalizations include 
\begin{itemize}
\item Knuth's negaFibonacci numbers, $F_{-n} = (-1)^{n + 1} F_n$ \cite[Eq.~(145), Section 7.1.3, Page 168]{knuth};
\item Stakhov's Fibonacci $p$-numbers, $F_p(n) = F_p(n - 1) + F_p(n - p - 1)$ when $n > p$ with initial values $F_p(0) = 0$ and $F_p(1) = \cdots = F_p(p) = 1$ \cite{stakhov2006};  and
\item Catarino and Borge's Leonardo numbers, $\text{Le}_n = \text{Le}_{n - 1} + \text{Le}_{n - 2} + 1$ with initial values of $\text{Le}_0 = \text{Le}_1 = 1$ \cite{catarino2019} (\seqnum{A001595}).
\end{itemize}
Further efforts to answer this inquiry were conducted by Tan and Leung who introduced the \textit{Leonardo $p$-numbers} in \cite{tan2023}. 
They are defined by the initial values $\mathcal{L}_p(0) = \dots = \mathcal{L}_p(p) = 1$ and by
\begin{displaymath}
  \mathcal{L}_p(n) = \mathcal{L}_p(n - 1) + \mathcal{L}_p(n - p - 1) + p \text{ when } n > p.
\end{displaymath}

The Leonardo $p$-numbers were further extended by Kuhapatanakul and Ruankong in \cite{kut:leo} to the \textit{generalized Leonardo $p$-numbers} $\mathcal{L}_{p,k}(n)$. These sequences are defined as
\begin{displaymath}
  \mathcal{L}_{p,k} = \mathcal{L}_{p,k}(n - 1) + \mathcal{L}_{p,k}(n - p - 1) + k \text{ when } n > p,
\end{displaymath}
and $\mathcal{L}_{p,k}(0) = \mathcal{L}_{p,k}(1) = \cdots = \mathcal{L}_{p,k}(p) = 1$.

What stands out is the restriction that the first $p+1$ values are equal to $1$. This leads us to our \textit{supergeneralized Fibonacci $p$-numbers}: 
instead of letting $\mathcal{L}_{p,k}(0) = \cdots = \mathcal{L}_{p,k}(p) = 1$, the supergeneralized Fibonacci $p$-numbers have $p+1$ freely chosen initial values.
It turns out that this sequence has a finite-termed, closed-form  expression that works for all initial values. We develop this formula over the course of this paper.

\section{\texorpdfstring{Supergeneralized Leonardo $p$-numbers}{Supergeneralized Leonardo p-numbers}}

To start this paper, we first introduce the central object of investigation: the supergeneralized Leonardo $p$-numbers, $\mathcal{L}_{p,k,\mathbf{x}}(n)$.
\begin{definition}
  For every fixed tuple $(p,k,\mathbf{x}) \in \mathbb{N} \times \mathbb{N}_0 \times \mathbb{R}^{p + 1}$, we define the supergeneralized Leonardo $p$-numbers, $\{ \mathcal{L}_{p,k,\mathbf{x}}(n) \}_{n \geq 0}$, to be
  \begin{displaymath}
    \mathcal{L}_{p,k,\mathbf{x}}(n) = \begin{cases}
      x_n, & \text{ for } 0 \leq n \leq p; \\
      \mathcal{L}_{p,k,\mathbf{x}}(n - 1) + \mathcal{L}_{p,k,\mathbf{x}}(n - p - 1) + k, & \text{ for } n > p.
    \end{cases}
  \end{displaymath}
\end{definition}

Note that all generalizations of the Fibonacci numbers mentioned in the introduction, with the notable exception of the negaFibonacci numbers, can be viewed as special cases of the family of sequences we introduce here.
Most of these variations can be obtained by setting $k$ and $p$ to a certain value and $\mathbf{x}$ to the vector of constant ones.
Note that for the Fibonacci ($p$-)numbers, many authors adopt the convention that $x_0 = 0$ instead of $1$, which we have followed in the list below.

\begin{itemize}
  \item If $\mathbf{x} = (1, 1, \dots, 1) \in \mathbb{R}^{p + 1}$, then we obtain the \textit{generalized Leonardo $p$-numbers} as introduced in \cite{kut:leo}.
  \item If $\mathbf{x} = (1, 1, \dots, 1) \in \mathbb{R}^{p + 1}$ and $k=p$, then we obtain the \textit{Leonardo $p$-numbers} as introduced in \cite{tan2023}.
  \item If $\mathbf{x} = (1, 1, \dots, 1) \in \mathbb{R}^{p + 1}$ and $p=1$, then we obtain the \textit{Leonardo numbers} as introduced in \cite{catarino2019}.
  \item If $\mathbf{x} = (0, 1, 1, \dots, 1) \in \mathbb{R}^{p + 1}$ and $k=0$, then we obtain the \textit{Fibonacci $p$-numbers} as introduced in \cite{stakhov2006}.
  \item If $\mathbf{x} = (0, 1) \in \mathbb{R}^{2}$, $p=1$ and $k=0$, then we obtain the \textit{Fibonacci numbers} (\seqnum{A000045}).
\end{itemize}


\section{\texorpdfstring{Relation to the Fibonacci $p$-numbers}{Relation to the Fibonacci p-numbers}}\label{sect1}
It is quite natural to wonder whether a generalization of something is still related to its original form.
In our case, we are interested in finding some relation between the supergeneralized Leonardo $p$-numbers and a simpler Fibonacci-like sequence.
There are several motivating examples.
For instance, the Leonardo numbers, $\text{Le}_n$, fulfil the identity that $\text{Le}_n = 2F_{n + 1} - 1$ \cite{origrelation}.
To add to this, the generalized Leonardo $p$-numbers, $\mathcal{L}_{p,k}$, are  intertwined with the Fibonacci $p$-numbers \cite{kut:leo} as they satisfy the relation that
\begin{displaymath}
  \mathcal{L}_{p,k}(n) = (k + 1)F_p(n + 1) - k.
\end{displaymath} 
In addition, Kuhapatanakul proved in \cite{reltop} that the Fibonacci $p$-numbers can be expressed using a finite sum of binomial coefficients, which yields an explicit expression for the generalized Leonardo $p$-numbers.
This motivates us to look for a relation between the supergeneralized Leonardo $p$-numbers and the Fibonacci $p$-numbers.
However, this task is not necessarily an easy one. 
When dealing with less general sequences, the initial values are known
to equal $1$, but the supergeneralized Leonardo $p$-numbers have arbitrary initial values.
This flexibility, while valuable, makes it harder to derive an explicit closed form for the sequence as the behaviour depends on the chosen initial condition,
which makes the analysis more complex.
Additionally, the introduction of the $k$ term further complicates the matter as this causes a significant disturbance to the sequence.
Despite this, the constant term is still a good point to start, as it is not affected by differing initial conditions.

\subsection{\texorpdfstring{Dealing with $k>0$}{Dealing with k>0}}
To begin tackling this problem, we first motivate why we may consider the problem concerning the initial values and that of $k>0$ separately (we deal with the case of $k=0$ separately in \cref{casek0}).
We may notice that
\[ \mathcal{L}_{p,k,\mathbf{x}}(n) \equiv \mathcal{L}_{p,0,\mathbf{x}}(n) \text{ (mod }k \text{)}.\]
This follows from the fact that a $k$ is added at the end of the definition and, if $n>2p$, both recursive terms have had a $k$ added earlier.
If not, one (or both) of the terms is equal to an initial value that is trivially equivalent to $\mathcal{L}_{p,0,\mathbf{x}}(n)$ modulo $k$.

This means that for fixed $p,k,\mathbf{x}$ there is an integer sequence $(q_n)_{n \in \mathbb{N}} \in \mathbb{N}_0$ such that
\begin{equation}\label{qnequ}
  \mathcal{L}_{p,k,\mathbf{x}}(n) = \mathcal{L}_{p,0,\mathbf{x}}(n) + q_n \cdot k.
\end{equation} 
To start our search for a closed-form expression for the sequence $q_n$, some values of 
$$\frac{\mathcal{L}_{p,k,\mathbf{x}}(p + j) - \mathcal{L}_{p,0,\mathbf{x}}(p + j)}{k}$$ are listed in \cref{tab:kval}.
\begin{table}[h]
  \centering
  \begin{tabular}{c|c}
    $j$ & $\frac{\mathcal{L}_{p,k,\mathbf{x}}(p + j) - \mathcal{L}_{p,0,\mathbf{x}}(p + j)}{k}$ \\ 
    \hline
    $1$ & $1$ \\ 
    $2$ & $2$ \\ 
    $3$ & $3$ \\
    $p-1$ & $p-1$ \\ 
    $p$ & $p$ \\
    $p+1$ & $p+1$ \\
    $p+2$ & $p+3$ \\
  \end{tabular}
  \caption{Some values of $\frac{\mathcal{L}_{p,k,\mathbf{x}}(p + j) - \mathcal{L}_{p,0,\mathbf{x}}(p + j)}{k}$ (i.e., the value of $q_{p+j}$ from \cref{qnequ}).}
  \label{tab:kval}
\end{table}

The apparent pattern of $q_{p+j}$ suggests that it is an index-shifted supergeneralized Leonardo $p$-sequence with initial values of $1,2,\dots,p$.

\begin{remark}
  In this paper, we only deal with $\mathcal{L}_{p,k,\mathbf{x}}(n)$ when $n \geq 0$. To allow for future generalizations, we require that $\mathcal{L}_{p,k,\mathbf{x}}(n) \leq 0$ when $n < 0$.
\end{remark}

\begin{theorem}\label{theo1}
  For positive integers $p,k$, a vector $\mathbf{x} \in \mathbb{R}^{p + 1}$ and a nonnegative integer $n$ let $\mathbf{y} = \left(1, \dots, p \right)^{\top}$ be a vector containing the integers from $1$ to $p$. Then
  \begin{displaymath}
    \mathcal{L}_{p,k,\mathbf{x}}(n) = \mathcal{L}_{p,0,\mathbf{x}}(n) + \max \left\{ 0, \mathcal{L}_{p,1,\mathbf{y}}(n - (p + 1)) \right\} \cdot k.
  \end{displaymath}
\end{theorem}
\begin{proof}
  Due to the fact that for $n \in 0, \dots, p$, the sequence need not follow a particular pattern, we have to distinguish between the case of $n \leq p$ and $n > p$. For the further, note that when $n \leq p \Longleftrightarrow n - (p + 1) < 0$. Consequently,
  \begin{displaymath}
    \mathcal{L}_{p,1,\mathbf{y}}(n - (p + 1)) \leq 0 \Longleftrightarrow \max \left\{ 0, \mathcal{L}_{p,1,\mathbf{y}}(n - (p + 1)) \right\} = 0.
  \end{displaymath}
  Additionally, by the definition of supergeneralized Leonardo $p$-numbers,
  \begin{displaymath}
    \mathcal{L}_{p,0,\mathbf{x}}(n) = x_n.
  \end{displaymath}
  It follows that
  \begin{displaymath}
    \underbrace{\mathcal{L}_{p,0,\mathbf{x}}(n)}_{= x_n} + \underbrace{\max \left\{ 0, \mathcal{L}_{p,1,\mathbf{y}}(n - (p + 1)) \right\} \cdot k}_{=  0} = x_n = \mathcal{L}_{p,k,\mathbf{x}}(n).
  \end{displaymath}
  This equality proves the theorem for this case.
  Our next step is to prove the theorem for $n>p$. 
  This would be an ideal situation for strong induction; however, we first need to distinguish between two cases before proceeding, as for $n \in [p+1, 2p+1]$ 
  we have.  $n - p - 1 < p$, which affects our ability to determine the value of $\mathcal{L}_{p,1,\mathbf{x}}(n - p -1)$.
  We begin with $n \in [p+1,2p+1]$ and use strong induction.
  As the base step, let $n = p + 1$ at which point we have that for the left-hand side,
  \begin{displaymath}
    \mathcal{L}_{p,k,\mathbf{x}}(p + 1) = \mathcal{L}_{p,k,\mathbf{x}}(p) + \mathcal{L}_{p,k,\mathbf{x}}(0) + k = x_p + x_0 + k
  \end{displaymath}
  and
  \begin{displaymath}
    \mathcal{L}_{p,0,\mathbf{x}}(p + 1) + \max \left\{ 0, \underbrace{\mathcal{L}_{p,1,\mathbf{y}}(0)}_{=1} \right\} \cdot k = \mathcal{L}_{p,0,\mathbf{x}}(p) + \mathcal{L}_{p,0,\mathbf{x}}(0) + k = x_p + x_0 + k
  \end{displaymath}
  for the right-hand side of the equation.
  Hence the theorem holds for our base case.
  Let our induction hypothesis be that the formula holds for all $p+i$ such that $p + 1 \leq p + i \leq p+j\leq 2p$ for some $j \in \mathbb{N}$. 
  As the induction step, consider $p+j+1$. Here, it follows that
  \begin{displaymath}
    \mathcal{L}_{p,k,\mathbf{x}}(p + j + 1) = \mathcal{L}_{p,k,\mathbf{x}}(p + j) + \mathcal{L}_{p,k,\mathbf{x}}(j) + k.
  \end{displaymath}
  By the induction hypothesis, this equals
  \begin{displaymath}
    \mathcal{L}_{p,0,\mathbf{x}}(p + j) + \max \left\{ 0, \mathcal{L}_{p,1,\mathbf{y}}(j - 1) \right\} \cdot k + \mathcal{L}_{p,k,\mathbf{x}}(j) + k.
  \end{displaymath}
  Note that $p + j + 1 \leq 2p+1 \Longleftrightarrow j - 1 \leq p - 1$. Therefore $\mathcal{L}_{p,1,\mathbf{y}}(j - 1) = j$. Using this we get that
  \begin{displaymath}
    \mathcal{L}_{p,0,\mathbf{x}}(p + j) + \mathcal{L}_{p,k,\mathbf{x}}(j) + (j + 1) \cdot k = \mathcal{L}_{p,0,\mathbf{x}}(p + j) + x_j + (j + 1) \cdot k.
  \end{displaymath}
  For the right-hand side we find that
  \begin{displaymath}
    \mathcal{L}_{p,0,\mathbf{x}}(p + j + 1) + \max \left\{ 0, \mathcal{L}_{p,1,\mathbf{y}}(j) \right\} \cdot k = \mathcal{L}_{p, 0, \mathbf{x}}(p + j) + \mathcal{L}_{p, 0, \mathbf{x}}(j) + \max \left\{ 0, \mathcal{L}_{p,1,\mathbf{y}}(j) \right\} \cdot k 
  \end{displaymath}
  \begin{displaymath}
    = \mathcal{L}_{p, 0, \mathbf{x}}(p + j) + \mathcal{L}_{p, 0, \mathbf{x}}(j) + (j + 1) \cdot k = \mathcal{L}_{p, 0, \mathbf{x}}(p + j) + x_j + (j + 1) \cdot k.
  \end{displaymath}
  This proves the theorem for the case of $n \leq 2p+1$. 
  It remains to be proven that the theorem holds for all $n > 2p+1$. 
  For brevity, we demonstrate only that the defined recurrence relation of the supergeneralized Leonardo $p$-numbers holds. 
  Consider
  \begin{displaymath}
    \mathcal{L}_{p,0,\mathbf{x}}(n - 1) + \max \left\{ 0, \mathcal{L}_{p,1,\mathbf{y}}(n - p - 2) \right\} \cdot k + \mathcal{L}_{p,0,\mathbf{x}}(n - p - 1) + \max \left\{ 0, \mathcal{L}_{p,1,\mathbf{y}}(n - 2p - 2) \right\} \cdot k.
  \end{displaymath}
  Since both $n - p - 2$ and $n - 2p - 2$ are greater or equal to zero and as $\mathcal{L}_{p,k,\mathbf{x}}(n)$ is positive for all $n \geq 0$, the $\max$ operator is redundant.
  Consequently,
  \begin{displaymath}
    \mathcal{L}_{p,0,\mathbf{x}}(n - 1) + \mathcal{L}_{p,0,\mathbf{x}}(n - p - 1) + \underbrace{\left( \mathcal{L}_{p,1,\mathbf{y}}(n - p - 2)  + \mathcal{L}_{p,0,\mathbf{x}}(n - 2p - 2) \right)}_{= \mathcal{L}_{p,1,\mathbf{y}}(n - p - 1)} \cdot k
  \end{displaymath}
  \begin{displaymath}
    = \mathcal{L}_{p,0,\mathbf{x}} + \max \left\{ 0, \mathcal{L}_{p,1,\mathbf{y}}(n - (p + 1)) \right\} \cdot k.
  \end{displaymath}
  This concludes our proof of this theorem, which gives us a closed form expression for $q_n$ from \cref{qnequ}.
\end{proof}

\subsection{\texorpdfstring{Case $k=0$}{Case k=0}}\label{casek0}
In the past subsection, we separated each element into one summand that is independent of $k$ and one that is dependent on it.
Additionally, we have expressed the latter using a simpler supergeneralized Leonardo $p$-sequence.
Although it might be tempting, we cannot ignore the issue of the arbitrary initial values forever, so we deal with them in this section.
To be precise, we look to connect $\mathcal{L}_{p,0,\mathbf{x}}(n)$ to the Fibonacci $p$-numbers (as there already exists a closed form expression for them).
To start, we have listed some values of $\mathcal{L}_{p,0,\mathbf{x}}(n)$ in \cref{tab:lval}.
\begin{table}[h]
  \centering
  \begin{tabular}{c|c}
    $n$ & $\mathcal{L}_{p,0,\mathbf{x}}(n)$ \\ 
   \hline 
    $0$ & $x_0$ \\ 
    $\leq p$ & $x_n$ \\ 
    $p+1$ & $x_0 + x_p$ \\
    $p+2$ & $x_0 + x_p + x_1$ \\ 
    $p+3$ & $x_0 + x_p + x_1 + x_2$ \\
    $2p$ & $x_0 + \cdots + x_{p} + x_{p - 1}$ \\
    $2p+1$ & $x_0 + \cdots + 2 \cdot x_{p} + x_{p - 1}$ \\
  \end{tabular}
  \caption{Some values of $\mathcal{L}_{p,0,\mathbf{x}}(n)$.}
  \label{tab:lval}
\end{table}

Looking at this table, we can see that the values may be modelled by Fibonacci $p$-numbers but offset by a certain amount so that $n - p$ is mapped to $F_p(0)$. 

\begin{theorem}\label{theo2}
  For positive integers $p,k$, a vector $\mathbf{x} \in \mathbb{R}^{p + 1}$ and a nonnegative integer $n$, we have that
  \begin{displaymath}
    \mathcal{L}_{p,0,\mathbf{x}}(n) = \begin{cases}
      x_n, & \text{ for } 0 \leq n \leq p; \\
      F_p(n - p + 1) \cdot x_p + \sum^{\min \{ p - 1, n - p - 1 \}}_{i = 0} F_p(n - p - i) \cdot x_i, & \text{ for } n > p.
    \end{cases}
  \end{displaymath}
\end{theorem}

\begin{proof}
  We define $\tilde{F}_p(n) := F_p(n - 1)$. 
  This is useful, as $F_p(0) = 0$ while $F_p(1) = \cdots = F_p(p) = 1$ and $F_p(p + 1) = 0 + 1 = 1$. 
  In our formula, it is preferable to shift the index so that $\tilde{F}_p(0) = 1 = \cdots = \tilde{F}_p(p)$ and $\tilde{F}_p(p + 1) = 2$.
  Additionally, we introduce
  \begin{displaymath}
    \phi(n) = \begin{cases}
      x_n, & \text{ for } 0 \leq n \leq p; \\
      \tilde{F}_p(n - p) \cdot x_p + \sum^{\min \{ p - 1, n - p - 1 \}}_{i = 0} \tilde{F}_p(n - p - i - 1) \cdot x_i & \text{ for } n > p.
    \end{cases}
  \end{displaymath}
  The goal is to demonstrate that $\phi(n) = \mathcal{L}_{p,0,\mathbf{x}}(n)$.
  For $0 \leq n \leq p$ the right- and left-hand side are equivalent by definition. 
  When $n > p$, we need to distinguish between the two cases of $p < n \leq 2p$ (when $p - 1 \geq n - p - 1$) and $n > 2p$ (when $n - p - 1 > p - 1$).
  This is necessary as the sum's upper bound is determined by a $\min$ operator. 
  In the first case, note that if $n \in (p, 2p]$ then $n - p \in (0, p]$ and thus $\tilde{F}_p(n - p) = 1$.
  As a result, $\phi(n)$ equals
  \begin{displaymath}
    x_p + \sum^{n - p - 1}_{i = 0} \tilde{F}_p(n - p - i - 1) \cdot x_i.
  \end{displaymath}
  Furthermore, consider $i \in [0, n - p - 1]$. Ergo, $0 \leq n - p - i - 1 \leq p$ and $\tilde{F}_p(n - p - 1 - i) = 1$ as well. Therefore
  \begin{displaymath}
    \phi(n) = x_p + \sum^{n - p - 1}_{i = 0} x_i.
  \end{displaymath}
  This simplifies, showing that the recurrence relation holds for $\phi$ for $p < n \leq 2p$ which, in combination with the fact that we have already shown that $\phi(n) = \mathcal{L}_{p,0,\mathbf{x}}(n)$ for the initial $p$ values; i.e., $0 \leq n \leq p-1$, would prove the result. Consider
  \begin{displaymath}
    \phi(n - 1) + \phi(n - p - 1) = x_p + \sum^{n - p - 2}_{i = 0} x_i + \phi(n - p - 1).
  \end{displaymath}
  When $n \in (p, 2p]$ we have that $0 \leq n - p - 1 < p$. Hence $\phi(n - p - 1) = x_{n - p - 1}$. So,
  \begin{displaymath}
    x_p + \sum^{n - p - 2}_{i = 0} x_i + x_{n - p - 1} = x_p + \sum^{n - p - 1}_{i = 0} x_i.
  \end{displaymath}
  This proves the equivalence for all $n \leq 2p$. We have $n > 2p \Longleftrightarrow n - p > p$. 
  We use strong induction for this part of the proof.
  As the base case, let $n = 2p + 1$. Then
  \begin{equation}\label{equtoref1}
    \phi(n) = \tilde{F}_p(n - p) \cdot x_p + \sum^{p - 1}_{i = 0} \tilde{F}_p(n - p - i - 1) \cdot x_i = \underbrace{\tilde{F}_p(p + 1)}_{=2} \cdot x_p + \sum^{p - 1}_{i = 0} \tilde{F}_p(p - i) \cdot x_i.
  \end{equation}
  On the other hand, we have that
  \begin{equation}\label{equtoref2}
    \phi(n - 1 ) + \phi(n - p - 1) = \phi(2p) + \phi(p) = x_p \cdot \tilde{F}_p(p) + \sum^{p - 1}_{i = 0} \tilde{F}_p(p - i - 1) \cdot x_i + x_p.
  \end{equation}
  Note at this point that $\tilde{F}_p(p - i) = \tilde{F}_p(p - i - 1) = 1 = 1$ because $p - i < p$. 
  Therefore, we have that $\phi(2p + 1) = \phi(2p) + \phi(p)$.
  Noting that $\phi(2p) = \mathcal{L}_{p,0,\mathbf{x}}(2p)$ and $\phi(p) = \mathcal{L}_{p,0,\mathbf{x}}(p)$ we conclude that the theorem holds for the base case.
  For the next step, let equality hold for all $i \leq 2p + j$ for some $j \in \mathbb{N}$ and consider $2p + j + 1$. On the one hand,
  \begin{displaymath}
    \phi(2p + j + 1) = x_p \cdot \tilde{F}_p(p + j + 1) + \sum^{p - 1}_{i = 0} \tilde{F}_p(p + j - i) \cdot x_i.
  \end{displaymath}
  On the other, consider,
  \begin{displaymath}
    \mathcal{L}_{p,0,\mathbf{x}}(2p + j) + \mathcal{L}_{p,0,\mathbf{x}}(p + j ) = \phi(2p + j) + \phi(p + j)
  \end{displaymath}
  \begin{displaymath}
    = x_p \cdot \tilde{F}_p(p + j + 1) + \sum^{p - 1}_{i = 0} \tilde{F}_p(p + j - i) \cdot x_i + x_p \cdot \tilde{F}_p(j) + \sum^{p - 1}_{i = 0} \tilde{F}_p(j - 1 - i) \cdot x_i.
  \end{displaymath}
  By rearranging the terms we find that this equals
  \begin{displaymath}
    x_p \cdot \underbrace{\left( \tilde{F}_p(p + j) + \tilde{F}_p(j) \right)}_{=\tilde{F}_p(p + j + 1)} + \sum^{p - 1}_{i = 0} \underbrace{\left( \tilde{F}_p(j - 1 - i) + \tilde{F}_p(p + j - i - 1) \right)}_{= \tilde{F}_p(p + j - i)} \cdot x_i.
  \end{displaymath}
  As a result, equality holds for $2p+j+1$ as well. Thus, the theorem is true by strong induction.
\end{proof}

\section{A closed form}
At this point, we have already made significant progress towards finding a closed form expression for the supergeneralized Leonardo $p$-numbers.
In \cref{sect1}, we dealt with the issue of the term $k>0$ and that of the initial values separately.
Additionally, we have found a way to express the latter using Fibonacci $p$-numbers for which there already exists a closed form expression.
However, as one might recall, in \cref{theo1}, we were only able to express the term $k>0$ in terms of $\mathcal{L}_{p,1,\mathbf{y}}(n)$, where $\mathbf{y}$ is a vector containing the integers from $1$ to $p$.
Nonetheless, this was not the goal we aimed to achieve.
We are still missing an explicit version for this term, which we find in
this section.

\subsection{\texorpdfstring{Modelling $k>0$}{Modelling k>0}}

As we have done twice already in this paper, we begin this subsection by calculating $\mathcal{L}_{p,1,\mathbf{y}}(n)$ for important pairs of $p$ and $n$. This is shown in \cref{tab:kb}.
\begin{table}[h]
  \centering
  \begin{tabular}{|c|cccc}
    $n$ & $\mathcal{L}_{1,1,\mathbf{y}}(n)$ & $\mathcal{L}_{2,1,\mathbf{y}}(n)$ & $\mathcal{L}_{3,1,\mathbf{y}}(n)$ & $\mathcal{L}_{4,1,\mathbf{y}}(n)$ \\ 
    \hline
    $0$ & $1$ & $1$ & $1$ & $1$ \\ 
    $1$ & $2$ & $2$ & $2$ & $2$ \\ 
    $2$ & $4$ & $3$ & $3$ & $3$ \\ 
    $3$ & $7$ & $5$ & $4$ & $4$ \\ 
    $4$ & $12$ & $8$ & $6$ & $5$ \\ 
    $5$ & $20$ & $12$ & $9$ & $7$ \\ 
    $6$ & $33$ & $18$ & $13$ & $10$ \\ 
    $7$ & $54$ & $27$ & $18$ & $14$ \\ 
    $8$ & $88$ & $40$ & $25$ & $19$ \\ 
    $9$ & $143$ & $59$ & $35$ & $25$ \\ 
    $10$ & $232$ & $87$ & $49$ & $33$ 
  \end{tabular}
  \caption{Some values of $\mathcal{L}_{p,1,\mathbf{x}}(n)$ for important pairs of $p$ and $n$.}
  \label{tab:kb}
\end{table}

Looking at the table, there is no clear pattern for the values at first glance, which may be attributed to the fact that we are dealing with two variables and an unclear growth.   We can look up the corresponding sequences in the OEIS \cite{OEIS2025}.
When $p=1$, the sequence is indexed by \seqnum{A000071} and modelled by $a(n) = F(n) - 1$. 
For $p=2$, it is sequence \seqnum{A077868} and is generated by $a(n) = \sum^{\lfloor \frac{n+1}{3} \rfloor}_{k = 0} \binom{n + 1 - 2 \cdot k}{k + 1}$.
The sequence when $p=3$ is \seqnum{A098578} and the corresponding
explicit form is $a(n) = \sum^ {\lfloor \frac{n + 1}{4} \rfloor}_{k = 0} \binom{n + 1 - 3 \cdot k}{k + 1}$. 
If $p=4$, the sequence is \seqnum{A099559} and $a(n) = \sum^{\lfloor \frac{n + 1}{5} \rfloor} \binom{n + 1 - 4 \cdot k}{k + 1}$. $\mathcal{L}_{p, 0, \mathbf{y}}(n)$ with $p > 4$ are seemingly not indexed in the \texttt{OEIS} as of now.
The explicit forms appear to follow a pattern, which we prove now.
\begin{theorem}\label{theo3}
  For positive integers $p,k$ and a nonnegative integer $n$, let $\mathbf{y} = \left(1, \dots, p \right)^{\top}$, a vector containing all integers from $1$ to $p$. 
  Then
  \begin{displaymath}
    \mathcal{L}_{p,1,\mathbf{y}}(n) = \sum^{\lfloor \frac{n+1}{p + 1} \rfloor}_{i = 0} \binom{n + 1 - p \cdot i}{i + 1}.
  \end{displaymath}.
\end{theorem}

\begin{proof}
  As a first step, let us introduce notation for an index shift on the right-hand side of the formula, namely,
  \begin{displaymath}
    f(n) = \sum^{\lfloor \frac{n}{p + 1} \rfloor}_{i = 0} \binom{n - p \cdot i}{i + 1}.
  \end{displaymath}
  To adjust our hypothesis accordingly, we demonstrate that $f(n + 1) = \mathcal{L}_{p,1,\mathbf{y}}(n)$.
  When $n \leq p$, we have that
  \begin{displaymath}
    f(n) = \sum^{\lfloor \frac{n}{p + 1} \rfloor}_{i = 0} \binom{n - p \cdot i}{i + 1} = \binom{n}{1} = n = \mathcal{L}_{p,1,\mathbf{y}}(n - 1).
  \end{displaymath}
  We demonstrate next that for $n \geq p$,
  \begin{displaymath}
    \mathcal{L}_{p,0,\mathbf{y}}(n) = f(n + 1) \Longleftrightarrow \mathcal{L}_{p,0,\mathbf{y}}(n - 1) + \mathcal{L}_{p,0,\mathbf{y}}(n - p - 1) = f(n + 1).
  \end{displaymath}
  Here, it suffices to show that
  \begin{displaymath}
    f(n + 1) = f(n) + f(n - p) + 1.
  \end{displaymath}
  This can be equivalently stated as
  \begin{equation}\label{hypo}
    \sum^{\lfloor \frac{n + 1}{p + 1} \rfloor}_{i = 0} \binom{n + 1 - p \cdot i}{i + 1} = \sum^{\lfloor \frac{n}{p + 1} \rfloor}_{i = 0} \binom{n - p \cdot i}{i + 1} + \sum^{\lfloor \frac{n - p}{p + 1} \rfloor}_{i = 0} \binom{n - p \cdot i - p}{i + 1} + 1.
  \end{equation}
  We prove an auxiliary result first.
  \begin{lemma}\label{auxres}
    For $J, n, p \in \mathbb{N}$ we have
    \begin{displaymath}
        1 + \sum^{J}_{i = 0} \binom{n - p \cdot i}{i + 1} + \sum^{J - 1}_{i = 0} \binom{n - p \cdot i - p}{i + 1} = \sum^{J}_{i = 0} \binom{n - p \cdot i + 1}{i + 1}.
    \end{displaymath}
  \end{lemma}
  \begin{proof}
    We begin by noticing that
    \begin{displaymath}
      1 + \sum^{J}_{i = 0} \binom{n - p \cdot i}{i + 1} + \sum^{J - 1}_{i = 0} \binom{n - p \cdot i - p}{i + 1} = 1 + \binom{n}{1} + \sum^{J}_{i = 1} \binom{n - p \cdot i}{i + 1} + \sum^{J - 1}_{i = 0} \binom{n - p \cdot i - p}{i + 1}.
    \end{displaymath}
    Applying an index shift gives us that this equals
    \begin{displaymath}
      1 + \binom{n}{1} + \sum^{J}_{i = 1} \binom{n - p \cdot i}{i + 1} + \sum^{J}_{i = 1} \binom{n - p\cdot i}{i}.
    \end{displaymath}
    At this point, recall Pascal's identity, which states that
    for all natural numbers $a,b$, we have
    \begin{displaymath}
      \binom{b}{a + 1} = \binom{b - 1}{a} + \binom{b - 1}{a + 1}.
    \end{displaymath}
    An application of this yields 
    \begin{displaymath}
      1 + \binom{n}{1} + \sum^{J}_{i = 1} \binom{n - p \cdot i + 1}{i + 1} = \sum^{J}_{i = 0} \binom{n - p \cdot i + 1}{i + 1},
    \end{displaymath}
    as desired.
  \end{proof}
  To actually prove our hypothesis (\cref{hypo}), we need to distinguish between two cases of $n$.
  We start with $n \not\equiv p$ (mod $p +1$).
  In this case,
  \begin{displaymath}
    \left\lfloor \frac{n + 1}{p + 1} \right\rfloor = \left\lfloor \frac{n}{p + 1} \right\rfloor = \left\lfloor \frac{n - p}{p + 1} \right\rfloor + 1.
  \end{displaymath}
  
  Let $J = \lfloor \frac{n + 1}{p + 1} \rfloor$. Then, \cref{hypo} equals
  \begin{displaymath}
    \sum^{J}_{i = 0} \binom{n - p \cdot i + 1}{i + 1} = \sum^{J}_{i = 0} \binom{n - p \cdot i}{i + 1} + \sum^{J - 1}_{i = 0} \binom{n - p \cdot i - p}{i + 1} + 1,
  \end{displaymath}
  which is true by \cref{auxres}.
  Let us now consider the other case of $n \equiv p$ (mod $p +1$).
  Thus,
  \begin{displaymath}
    \left\lfloor \frac{n + 1}{p + 1} \right\rfloor = \left\lfloor \frac{n}{p + 1} \right\rfloor + 1 \text{ and } \left\lfloor \frac{n - p}{p + 1} \right\rfloor = \left\lfloor \frac{n}{p + 1} \right\rfloor.
  \end{displaymath}
  We may notice that
  \begin{displaymath}
    \sum^{\lfloor \frac{n+1}{p+1} \rfloor}_{i=0} \binom{n + 1 - p \cdot i}{i + 1} = \sum^{\lfloor \frac{n}{p + 1} \rfloor}_{i=0} \binom{n + 1 - p \cdot i}{i+1} + \underbrace{\binom{n - p \cdot \frac{n+1}{p+1} + 1}{\frac{n+1}{p+1}}}_{= 0}
  \end{displaymath}
  and
  \begin{displaymath}
    \sum^{\lfloor \frac{n - p}{p+1} \rfloor}_{i=0} \binom{n - p \cdot i - p}{i + 1} = \sum^{\lfloor \frac{n - p}{p + 1} \rfloor - 1}_{i=0} \binom{n - p \cdot i - i}{i + 1} + \underbrace{\binom{n - p \cdot \frac{n - p}{p + 1} - p}{\frac{n - p}{p + 1}}}_{= 0}.
  \end{displaymath}
  Letting $J = \lfloor \frac{n}{p+1} \rfloor$ and using these two identities, we may rewrite \cref{hypo} as
  \begin{displaymath}
    \sum^{J}_{i = 0} \binom{n - p \cdot i + 1}{i + 1} = 1 + \sum^{J}_{i = 0} \binom{n - p \cdot i}{i + 1} + \sum^{J - 1}_{i = 0} \binom{n - p \cdot i - p}{i + 1},
  \end{displaymath}
  which, again, is true by \cref{auxres}.
  Hence, we may conclude that the theorem holds.
\end{proof}

\subsection{Final result}
Finally, we have all the necessary tools to give a fully explicit and closed form for the supergeneralized Leonardo $p$-numbers.
All that needs to be done is to combine the results from \cref{theo1}, in which we proved that we may deal with the issue of the constant $k>0$ and that of the initial values separately, \cref{theo2}, in which we found an explicit formula for the initial values (or, to be more precise, for $\mathcal{L}_{p,0,\mathbf{x}}(n)$) and \cref{theo3}, in which we gave an explicit formula involving the binomial coefficient for the function modelling the $k$ term.

\begin{corollary}\label{coro1}
  For positive integers $p,k$, a vector $\mathbf{x} \in \mathbb{R}^{p + 1}$ and a nonnegative integer $n>p$, we have
  \begin{equation}
    \mathcal{L}_{p,k,\mathbf{x}}(n) = F_p(n - p + 1) \cdot x_p + \sum^{\min \{ p - 1, n - p - 1 \}}_{i = 0} F_p(n - p - i) \cdot x_i + \max \left\{0, \sum^{\lfloor \frac{n-p}{p + 1} \rfloor}_{k = 0} \binom{n - p - p \cdot k}{k + 1} \right\}.
  \end{equation}
\end{corollary}

\begin{proof}
  This corollary is an immediate result of a combination of \cref{theo1}, \cref{theo2} and \cref{theo3}.
\end{proof}

In order to complete the closed form, we use the explicit formula for $F_p(n)$ introduced by Kuhapatanakul in \cite{reltop}:
\begin{theorem}[Kuhapatanakul]\label{theo4}
  Let $p,n$ be two nonnegative integers. Then
  \begin{displaymath}
    F_p(n + 1) = \sum^{\lfloor \frac{n}{p + 1} \rfloor}_{i = 0} \binom{n - i \cdot p}{i}.
  \end{displaymath}
  Or, equivalently stated,
  \begin{displaymath}
    F_p(n) = \sum^{\lfloor \frac{n - 1}{p + 1} \rfloor}_{i = 0} \binom{n - 1 - i \cdot p}{i}.
  \end{displaymath}
\end{theorem}
Combining this with \cref{coro1} gives us the final result.
\begin{theorem}
  For positive integers $p,k$, a vector $\mathbf{x} \in \mathbb{R}^{p + 1}$ and a nonnegative integer $n>p$, we have that
  \begin{equation}
    \begin{split}
    \mathcal{L}_{p,k,\mathbf{x}}(n) = \left( \sum^{\lfloor \frac{n - p}{p + 1} \rfloor}_{i = 0} \binom{n - p - i \cdot p}{i} \right) \cdot x_p \\ + \sum^{\min \{ p - 1, n - p - 1 \}}_{i = 0} \left( \sum^{\lfloor \frac{n - p - i - 1}{p + 1} \rfloor}_{k = 0} \binom{n - p - i - 1 - k \cdot p}{k} \right) \cdot x_i \\ + \max \left\{0, \sum^{\lfloor \frac{n-p}{p + 1} \rfloor}_{k = 0} \binom{n - p - p \cdot k}{k + 1} \right\}.
    \end{split}
  \end{equation}
\end{theorem}
 
\begin{proof}
  This theorem is an immediate result of \cref{coro1} and \cref{theo4}.
\end{proof}

\section{Conclusion and further research}
In this paper, we have successfully found an explicit and closed form expression for the supergeneralized Leonardo $p$-numbers.
We found that even if the initial condition is arbitrarily chosen, the sequence can always be represented using the Fibonacci $p$-numbers.
Additionally, we found that the behaviour of the term $k$---though seemingly unrelated to the supergeneralized Leonardo $p$-numbers---can be described using them as well.
This could imply that this family of sequences might appear in a variety of different contexts when studying other recurrent sequences.
Additionally, we found a way to model this term using a sum of binomial coefficients, which might prove useful in the study of Pascal's triangle and connected topics.
In the end, we combined our findings and previous results to give a long (and, admittedly, somewhat unwieldy) explicit formula for the supergeneralized Leonardo $p$-numbers.
This formula consists of a sum of binomial coefficients, each multiplied by corresponding initial values.
This connection is interesting, as it shows us that even if we remove the constraint on the initial values, they still are related to structures that the special cases are related to as well.
Further research could attempt to extend the domain of these sequences to the negative numbers, perhaps finding a connection to the negaFibonacci numbers.
Admittedly, the question of whether a further generalization of the supergeneralized Leonardo $p$-numbers is useful remains open. 


\begin{thebibliography}{10}

\bibitem{origrelation}
Urszula Bednarz and Ma{\l}gorzata Wo{\l}owiec-Musia{\l}, {Generalized}
  {Fibonacci-Leonardo} numbers, {\em J. Difference Equ. Appl.}
  {\bf 30} (2024), 111--121.

\bibitem{catarino2019}
P.~Catarino and A.~Borges, On {Leonardo} numbers, {\em Acta Math. Univ. Comenian.} {\bf 89} (2019), 75--86.

\bibitem{OEIS2025}
OEIS~Foundation Inc., The On-Line Encyclopedia of Integer Sequences,
  \url{https://oeis.org}, 2025.

\bibitem{knuth}
Donald~E. Knuth, {\em The Art of Computer Programming}, Vol.~4A,
  Addison-Wesley, 1973.

\bibitem{reltop}
Kantaphon Kuhapatanakul, The {Fibonacci} p-numbers and {Pascal's} triangle,
  {\em Cogent Math.} {\bf 3} (2016).

\bibitem{kut:leo}
Kantaphon Kuhapatanakul and Pongpol Ruankong, On generalized {Leonardo}
  p-numbers, {\em J. Integer Sequences} {\bf 27} (2024),
  \href{https://cs.uwaterloo.ca/journals/JIS/VOL27/Kuhapatanakul/kuha13.html}{Article 24.4.6}.

\bibitem{fibmusic}
Flavia Lanini, Deborah Kyburz, and Kathrin Reith, {\em Fibonacci. Un ponte sul
  {Mediterraneo}}, Reception of {Fibonacci} numbers and the golden ratio,
  ETH Z{\"u}rich, 10 2003.
\newblock \href{https://library.ethz.ch/en/locations-and-media/platforms/virtual-exhibitions/fibonacci-un-ponte-sul-mediterraneo/reception-of-fibonacci-numbers-and-the-golden-ratio/bela-bartok-the-golden-ratio-in-music.html#:~:text=The%20golden%20ratio%20occurs%20in,proportion%20of%20the%20golden%20ratio}{Section B{\'e}la {Bart{\'o}k}---the golden ratio in music, Virtual
  exhibition}.

\bibitem{inigo2019college}
Maya Lanzetta, Kim Sonier, Maxie Inigo, Jennifer Jameson, and Kathryn Kozak,
  {\em College Mathematics for Everyday Life}, Coconino Community College,
  2015.

\bibitem{stakhov2006}
A.~P. Stakhov, Fibonacci matrices, a generalization of the {Cassini} formula,
  and a new coding theory, {\em Chaos, Solitons \& Fractals} {\bf 30} (2006),
  56--66.

\bibitem{tan2023}
E.~Tan and H.~H. Leung, On {Leonardo} $p$-numbers, {\em Integers} {\bf 23}
  (2023), Paper A7.

\end{thebibliography}

\bigskip
\hrule
\bigskip

\noindent 2020 {\it Mathematics Subject Classifications}: Primary
11B39; Secondary 11B65, 11B83. 

\noindent \emph{Keywords:} Fibonacci sequence, Fibonacci $p$-numbers, Leonardo numbers, Leonardo $p$-numbers, generalized Leonardo $p$-numbers, supergeneralized Leonardo $p$-numbers.

\bigskip
\hrule
\bigskip

\noindent (Concerned with sequences 
\seqnum{A000045},
\seqnum{A000071},
\seqnum{A001595},
\seqnum{A077868},
\seqnum{A098578}, and
\seqnum{A099559}.)

\bigskip
\hrule
\bigskip

\vspace*{+.1in}
\noindent
Received October 30 2024;
revised versions received October 31 2024; May 1 2025.
Published in {\it Journal of Integer Sequences}, December 11 2025.

\bigskip
\hrule
\bigskip

\noindent
Return to \href{https://cs.uwaterloo.ca/journals/JIS/}{Journal of Integer Sequences home page}.
\vskip .1in


\end{document}

                                                                                

