\documentclass[12pt,reqno]{article}

\usepackage[usenames]{color}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{amscd}

\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,amsmath,amssymb}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{latexsym}
\usepackage{epsf}

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

\newcommand{\seqnum}[1]{\href{http://oeis.org/#1}{\underline{#1}}}
\def\modd#1 #2{#1\ ({\rm mod}\ #2)}
\newcommand{\lf}{\left\lfloor}
\newcommand{\rf}{\right\rfloor}

\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}
\newtheorem*{notation*}{Notation}

\begin{center}
\vskip 1cm{\LARGE\bf Infinite Products Arising in Paperfolding
}
\vskip 1cm
% first column
\begin{minipage}[t]{0.5\textwidth}
\begin{center}
Leyda Almodovar  \\
Department of Mathematics \\
University of Iowa\\
Iowa City, IA 52242 \\
USA  \\
\href{mailto:leyda-almodovar@uiowa.edu}{\tt leyda-almodovar@uiowa.edu} \\
\ \\
Hadrian Quan \\
Department of Mathematics \\ 
UC Santa Cruz \\
Santa Cruz, CA 95064 \\
USA \\
\href{mailto:hquan1@ucsc.edu}{\tt hquan1@ucsc.edu} \\
\ \\
Eric Rowland\\
Department of Mathematics\\
University of Liege\\
Belgium \\
\href{mailto:rowland@lacim.ca}{\tt rowland@lacim.ca} \\
\end{center}
\end{minipage}
%second column
\begin{minipage}[t]{0.4\textwidth}
\begin{center}
Victor H. Moll \\
Department of Mathematics  \\
Tulane University  \\
New Orleans, LA 70118 \\
USA\\
\href{mailto:vhm@tulane.edu}{\tt vhm@tulane.edu} \\
\ \\
Fernando Roman \\ 
Department of Mathematics \\
Kansas State University \\
Manhattan, KS 66506 \\
USA \\
\href{mailto:yahdiel@ksu.edu}{\tt yahdiel@ksu.edu} \\
\ \\
Michole Washington \\
Department of Mathematics  \\ 
Georgia Institute of Technology \\
Atlanta, GA 30332 \\
USA \\
\href{mailto:mwashington9@gatech.edu}{\tt mwashington9@gatech.edu}
\end{center}
\end{minipage}
\end{center}

\vskip .2in

\begin{abstract}
J.-P.~Allouche recently examined two infinite products where the term is a rational function of the index $n$ raised to 
the term of the paperfolding sequence $\epsilon_{n}$. A closed form is given only for one of them.
We discuss an attempt to 
produce the missing closed form.  We give a detailed analysis of convergence and a closed form  for 
the analogous question, where the 
paperfolding sequence is replaced by a periodic one.
\end{abstract}


\section{Introduction}

The \textit{paperfolding sequence} $\epsilon_{n}$ is defined by the rules 
\begin{eqnarray}
\epsilon_{2n} & = & (-1)^{n} \label{paper-fold-def0} \\
\epsilon_{2n+1} & = &\epsilon_{n}. \nonumber
\end{eqnarray}
 The first few values are 
 $\{ 1, \, 1, \, -1, \, 1, \, 1 \}$.  For fixed $a \in \mathbb{N}$, the rules \eqref{paper-fold-def0} 
 determine all subsequences of the form 
 \begin{equation}
 \{\epsilon_{2^{a}n+b}: \, a \in \mathbb{N}, \, 0 \leq b < 2^{a} \}
 \end{equation}
 in terms of constants, $\{ \epsilon_{n} \}$ and $\{ (-1)^{n} \}$. For example, when $a=2$,
 \begin{equation}
 \epsilon_{4n} = 1, \, \epsilon_{4n+1} = \epsilon_{2n} = (-1)^{n}, \, 
 \epsilon_{4n+2} = (-1)^{2n+1} = -1, \, \epsilon_{4n+3} = \epsilon_{2n+1} = \epsilon_{n}.
 \end{equation}
 
 
 The work presented here is motivated by results given by 
 Allouche~\cite{allouche-2014a}. In particular, the evaluation 
 \begin{equation}
B =  \prod_{n=1}^{\infty} \left( \frac{2n}{2n+1} \right)^{\epsilon_{n}} = \frac{1}{8 \sqrt{2 \pi}} 
 \Gamma \left( \frac{1}{4} \right)^{2}
 \end{equation}
 is obtained using the auxiliary product 
 \begin{equation}
A =  \prod_{n=0}^{\infty} \left( \frac{2n+1}{2n+2} \right)^{\epsilon_{n}}.
\label{prod-A-11}
 \end{equation}
 Indeed, the identity
 \begin{equation}
 AB = \frac{1}{2} \prod_{n=1}^{\infty} \left( \frac{n}{n+1} \right)^{\epsilon_{n}}
 \end{equation}
 is split according to the parity of $n$ and \eqref{paper-fold-def0} yields 
 \begin{equation}
 AB = \frac{1}{2} A \prod_{n=1}^{\infty} \left( \frac{2n}{2n+1} \right)^{(-1)^{n}}.
 \end{equation}
 The non-vanishing of $A$ gives
 \begin{equation}
 B = \frac{1}{2} \prod_{n=0}^{\infty} \frac{ (4n+4)(4n+3)}{(4n+5)(4n+2)}.
 \end{equation}
 A classical result expressing such products in terms of the gamma function gives the value of $B$. Observe that 
 the value of $A$ does not come from this formulation. A search for a closed form for $A$ was the motivation for the 
 results presented here. 

 


An early evaluation of an infinite product was produced by Wallis in his representation
\begin{equation}
\prod_{n=1}^{\infty} \frac{(2n)(2n)}{(2n-1)(2n+1)} = \frac{\pi}{2}.
\end{equation} 
The history of this discovery appears in Osler \cite{osler-2010b}.  The literature contains a variety of infinite product evaluations.  
For instance, 
\begin{equation}
\prod_{n=1}^{\infty} \left( 1 + \frac{1}{F_{2^{n}+1}} \right) = \frac{3}{\varphi} 
\text{ and }
\prod_{n=1}^{\infty} \left( 1 + \frac{1}{L_{2^{n}+1}} \right) = 3 - \varphi,
\end{equation}
is given by Sondow~\cite{sondow-2011a}. Here $F_{n}, \, L_{n}$ are the Fibonacci (Lucas) numbers  and 
$\varphi = \tfrac{1}{2}(\sqrt{5}+1)$ is the golden ratio. 

The value of infinite products usually involves classical constants of analysis. For instance, Borwein~\cite{borweinp-1993a} evaluates the function 
\begin{equation}
D(x) = \lim\limits_{n \to \infty} \prod_{k=1}^{2n+1} \left( 1 + \frac{x}{k} \right)^{(-1)^{k+1}k}
\end{equation}
as a generalization of the values 
\begin{equation}
\prod_{n=1}^{\infty} \left( 1 + \frac{2}{n} \right)^{(-1)^{n+1}n} = \frac{\pi}{2e}  \quad \text{ and } \quad 
\prod_{n=1}^{\infty} \left( 1 + \frac{2}{n} \right)^{(-1)^{n}n} = \frac{6}{\pi e}
\end{equation} 
established by Melzak~\cite{melzak-1961a}. Some exact evaluations are given in terms of 
the constant 
\begin{equation}
A_{1} = \exp\!\left( \frac{1}{4} - \int_{0}^{\infty} \frac{e^{-s}}{s^{3}} 
\left( 1 - \frac{s}{2} + \frac{s^{2}}{12} - \frac{s}{e^{s}-1} \right) \, ds \right)
\end{equation}
and the Catalan constant
\begin{equation}
G = \sum_{n=0}^{\infty} \frac{(-1)^{n}}{(2n+1)^{2}}.
\end{equation}
Examples include
\begin{equation}
D(1) = \frac{A_{1}^{6}}{2^{1/6} \sqrt{\pi}} \text{ and }
D \left( \tfrac{1}{4} \right) = 
\frac{2^{1/6} \sqrt{\pi} A_{1}^{3}}{\Gamma \left( \tfrac{1}{4} \right)} e^{G/\pi}.
\end{equation}
Other types of products involving gamma factors have recently been analyzed by Chamberland and Straub~\cite{chamberland-2013a}. 

The question considered here deals with the evaluation of products of the form 
\begin{equation}
\mathfrak{P}(R,s) = \prod_{n=1}^{\infty} R(n)^{s_{n}}.
\label{gen-prod1}
\end{equation}
Here $R$ is a rational function and $s$ is an \textit{automatic  sequence} (as studied 
by Allouche~\cite{allouche-2014a}). Examples 
include periodic sequences taking values in the alphabet 
$\{ +1, \, -1 \}$ or \textit{$k$-automatic sequences}: a sequence $\{ s_{n}: \, n \geq 0 \}$ is 
$k$-automatic if the set of subsequences $\{ s_{k^{j}n+\ell}: \, n \geq 0 \}$ with $j \geq  0, \, 
\ell \in [0, \, k^{j}-1 ]$ is finite. More information about such sequences appears in 
\cite{allouche-shallit-2003a}. 

The main example discussed here is the \textit{paperfolding sequence} $\epsilon_{n}$  defined in 
\eqref{paper-fold-def0}. Splitting the evaluation of a product into even and odd indices leads, in the special case of 
a rational function of degree $1$, to the  identity
\begin{equation}
\prod_{n=0}^{\infty} \left(  \frac{\alpha n+\beta}{\gamma n+\delta} \right)^{\epsilon_{n}} = 
\prod_{n=0}^{\infty} \left( \frac{2 \alpha n+\beta }{2 \gamma n+ \delta} \right)^{(-1)^{n}} \times 
\prod_{n=0}^{\infty} \left( \frac{2 \alpha n+ \alpha + \beta}
{2 \gamma n+ \gamma + \delta} \right)^{\epsilon_{n}}.
\label{folding-1}
\end{equation}
The exponent $(-1)^{n}$ appearing in the first product  on the right is a  periodic sequence of period length $2$. This
motivates the evaluation  of products with terms of the form $R(n)^{M_{n}}$ where $M_{n}$ is a 
periodic sequence.  This is the topic of Sections~\ref{sec:convergence}--\ref{sec:con-period}.

Section~\ref{sec:convergence} discusses the convergence of the product 
\begin{equation}
\mathfrak{P}(R,1) = \prod_{n=0}^{\infty} R(n),
\label{prod-M1}
\end{equation}
where 
\begin{equation}
R(z) = \frac{(z+a_{1}) \cdots (z+a_{d})}{(z+b_{1}) \cdots (z+b_{d})}.
\end{equation}
This section reviews  the elementary arguments showing that convergence in \eqref{prod-M1} is 
equivalent to $R(n) \to 1$ 
as $n \to \infty$ and $\mathfrak{S}(R) = 0$. Here
\begin{equation}
\mathfrak{S}(R) = \sum_{b \in R^{-1}(\infty)} b - \sum_{a \in R^{-1}(0)} a.
\label{pzsum}
\end{equation} 
The value of $\mathfrak{P}(R,1)$ is then given by 
\begin{equation}
 \prod_{n=0}^{\infty} \frac{(n+a_{1}) \cdots (n+a_{d})}{(n+b_{1}) \cdots (n+b_{d})} = 
\prod_{k=1}^{d} \frac{\Gamma(b_{k})}{\Gamma(a_{k})}.
\end{equation}
Section~\ref{sec:simple} discusses the convergence of products $\mathfrak{P}(R,M)$, where $R$ is a rational function 
and $M$ is a periodic sequence of period length $2$. Section~\ref{sec:con-period} extends the results to any
 periodic sequence,  with 
special emphasis on period lengths $3$ and $4$.  Section~\ref{sec:paperfolding} 
considers some infinite products related to the paperfolding sequence, and Section~\ref{sec:automatic} considers a generalization to certain $k$-automatic sequences.
An alternative proof of the evaluation of Allouche's product $B$ is presented and a new form of the product $A$ is given.  The question of existence of a 
 closed form for $A$ remains open. 




\section{Convergence of infinite products} \label{sec:convergence}

This section considers the simplest type of product \eqref{gen-prod1}: $R$ is a given 
rational function and $s_{n} \equiv 1$.  The data for the rational function is 
 a sequence of complex numbers $\{ a_{k} \}$ and $\{b_{k} \}$ where 
$a_{k}, \, b_{k}$ are not $0$ nor a negative integer. The convergence of the partial finite products 
\begin{equation}
\mathfrak{P}_{r}(R,1)  = \prod_{n=1}^{r} \frac{(n+a_{1}) \cdots (n+a_{d})}{(n+b_{1}) \cdots (n+b_{r})}
\end{equation} 
is examined first.


\begin{theorem}
\label{thm-infprod}
The infinite product 
\begin{equation}
\mathfrak{P}(R,1)  = \prod_{n=1}^{\infty} \frac{(n+a_{1}) \cdots (n+a_{d})}{(n+b_{1}) \cdots (n+b_{r})}
\end{equation}
converges if and only if $d = r$ and $a_{1}+ \cdots + a_{d}  = b_{1} + \cdots + b_{r}$; that is, 
$R(n) \to 1$ and $\mathfrak{S}(R) = 0$.
\end{theorem}
\begin{proof}
The convergence of a product  $\prod (1+ u_{k})$ is equivalent to the convergence of the series 
$\sum u_{k}$. Therefore $u_{k} \to 0$ is a necessary condition for convergence. This implies 
$d=r$. On the other hand 
\begin{equation}
 \frac{(n+a_{1}) \cdots (n+a_{d})}{(n+b_{1}) \cdots (n+b_{r})} = 
 1 + \left( a_{1}+ \cdots + a_{d} - b_{1} - \cdots - b_{r} \right) \frac{1}{n} + O(1/n^{2}),
 \end{equation}
 and the second condition on the parameters $a_{k}, \, b_{k}$ is now clear.
 \end{proof}
 
 The next question is the evaluation of the limiting product.  The motivation for the final result is this: consider 
 the problem of producing  a function $h(z)$ with zeros at a prescribed sequence $\{ z_{n} \}$. This is 
 elementary if the sequence is finite: the solution is simply given as 
 \begin{equation}
 P(z) = \prod_{n=1}^{N} \left( 1 - \frac{z}{z_{j}} \right)
 \end{equation}
 when $z_{j} \neq 0$.  On the other hand, if the sequence is infinite, convergence  issues might appear. For 
 instance, if one would like to have a function that vanishes precisely at the negative integers, then the natural first 
 attempt 
 \begin{equation}
 P_{1}(z) = \prod_{n=1}^{\infty} \left( 1 + \frac{z}{n} \right)
 \end{equation}
 fails to converge. To fix this, introduce an exponential correction and form the partial products 
 \begin{eqnarray}
 P_{2,N}(z) & = &  e^{z \left(1+ \tfrac{1}{2} + \tfrac{1}{3} +\cdots +  \tfrac{1}{N} \right) } 
 \prod_{n=1}^{N} \left( 1 + \frac{z}{n} \right)e^{-z/n} \\ 
 & = & e^{z \left(E_{1}(N) + \ln N \right) } 
 \prod_{n=1}^{N} \left( 1 + \frac{z}{n} \right)e^{-z/n}, \nonumber
 \end{eqnarray}
 with 
  \begin{equation}
 E_{1}(N) = 1 + \frac{1}{2} + \cdots + \frac{1}{N} - \ln N.
 \end{equation}
 The limit 
 \begin{equation}
 \gamma = \lim\limits_{N \to \infty} E_{1}(N) 
 \end{equation}
 is the famous \textit{Euler constant}. Therefore, the modified product 
 \begin{equation}
 \frac{P_{2,N}(z)}{N^{z}} := e^{z E_{1}(N)} \prod_{n=1}^{N} \left( 1 + \frac{z}{n} \right)e^{-z/n}
 \end{equation}
 has a limit as $N \to \infty$. The infinite product has zeros at the negative integers.  It turns out to be 
 convenient to write an infinite product with poles at the negative integers and also to include $0$ as 
 a pole. This yields the classical \textit{gamma function} $\Gamma(z)$. The functional equation 
 $\Gamma(z+1) = z \Gamma(z)$ is used to simplify the result.

 
 \begin{theorem}
 The infinite product representation of the gamma function is given by 
 \begin{equation}
 \prod_{n=1}^{\infty} \left(1 + \frac{z}{n} \right)^{-1} e^{z/n}
 =  e^{\gamma z} \Gamma(z+1).  
 \end{equation}
 \end{theorem}


It is now easy to write the value of the infinite product 
\begin{equation}
\mathfrak{P}(R,1)  = \prod_{n=1}^{\infty} \frac{(n+a_{1}) \cdots (n+a_{d})}{(n+b_{1}) \cdots (n+b_{r})}
\label{product-0}
\end{equation}
in Theorem~\ref{thm-infprod}. Start with 
\begin{equation}
\mathfrak{P}(R,1)  = \prod_{n=1}^{\infty} \frac{(1+b_{1}/n)^{-1}e^{b_{1}/n} \cdots (1+b_{r}/n)^{-1} e^{b_{r}/n}}
{(1+a_{1}/n)^{-1} e^{a_{1}/n}\cdots (1+a_{d}/n)^{-1} e^{a_{d}/n}}
\label{product-1}
\end{equation}
and observe that the added exponential terms amount to $1$.  Passing to the limit in \eqref{product-1} gives 
\begin{equation}
\mathfrak{P}(R,1) = 
\prod_{k=1}^{d} \frac{\Gamma(b_{k}+1)}{\Gamma(a_{k}+1)}.
\end{equation}
To simplify the form of the result, shift $n$ to $n+1$ in \eqref{product-0} to produce the following result.

\begin{theorem}
\label{finite-gamma}
Let $a_{k}, \, b_{k} \in \mathbb{C}$ none of which are $0$ or negative integers. Assume 
\begin{equation}
a_{1} + \cdots + a_{d} = b_{1} + \cdots + b_{d}.
\label{condition}
\end{equation}
Then 
\begin{equation}
 \prod_{n=0}^{\infty} \frac{(n+a_{1}) \cdots (n+a_{d})}{(n+b_{1}) \cdots (n+b_{d})} = 
\prod_{k=1}^{d} \frac{\Gamma(b_{k})}{\Gamma(a_{k})}.
\end{equation}
\end{theorem}




\section{The first  example: Sequences of period length $2$} 
\label{sec:simple}

This section considers products of the form 
\begin{equation}
\mathfrak{P}(R,M) := \prod_{n=0}^{\infty} R(n)^{M_{n}} 
\end{equation}
where $M_{n} = (-1)^{n}$.

Start with the representation 
\begin{equation}
\label{fact-R}
R(z) = C \frac{(z+a_{1}) \cdots (z+a_{d})}{(z+b_{1}) \cdots  (z+b_{r})}.
\end{equation}  
The partial products of  $\mathfrak{P}(R, s)$ are 
\begin{equation}
\prod_{n=0}^{N} R(n)^{(-1)^{n}} =  \prod_{n=0}^{\lf N/2 \rf} \frac{R(2n)}{R(2n+1)} \times 
\begin{cases}
	1, & \text{if $N$ is odd;} \\
	R(N+1), & \text{if $N$ is even}.
\end{cases}
\label{conv-pp}
\end{equation}
The first factor on the right in \eqref{conv-pp} is connected to the product $\mathfrak{P}(R_{1},1)$, where 
\begin{equation}
R_{1}(z) = \frac{R(2z)}{R(2z+1)}.
\label{prod-111}
\end{equation}
Its  convergence is decided by Theorem~\ref{thm-infprod}. 
It is clear that the product on the left-hand side of \eqref{conv-pp} converges if and only if both factors on the right 
converge separately.

In particular, if  $\mathfrak{P}(R,M)$ converges, then 
$\begin{displaystyle} \lim\limits_{n \to \infty} R(n) = 1 \end{displaystyle}$ and it must be that 
$C=1$ in \eqref{fact-R}. To 
complete the discussion, it suffices to determine conditions under which $\mathfrak{P}(R_{1},1)$ 
is finite.  The rational function \eqref{prod-111} factors as 
\begin{equation}
R_{1}(z) = \frac{(2z+a_{1}) \cdots (2z+a_{d})}{(2z+b_{1}) \cdots  (2z+b_{r})}  \times 
\frac{(2z+1+b_{1}) \cdots (2z+1+b_{r})}{(2z+1+a_{1}) \cdots  (2z+1+a_{d})},
\end{equation}
with   $d+r$ zeros at 
\begin{equation}
-\tfrac{1}{2} a_{1}, \, \dots, -\tfrac{1}{2}a_{d}, \, -\tfrac{1}{2}(1+b_{1}), \dots, -\tfrac{1}{2}(1+ b_{r})
\end{equation}
and $d+r$ poles at 
\begin{equation}
-\tfrac{1}{2} b_{1}, \, \dots,  -\tfrac{1}{2}b_{r}, \, -\tfrac{1}{2}(1+a_{1}), \dots, -\tfrac{1}{2}(1+ a_{d}).
\end{equation}
Since $R_{1}(z) \to 1$ as $z \to \infty$, convergence in 
\eqref{conv-pp} requires the relation
\begin{equation}
\sum_{k=1}^{d} a_{k} + \sum_{k=1}^{r} (1+ b_{k}) = 
\sum_{k=1}^{r} b_{k} + \sum_{k=1}^{d} (1+ a_{k}).
\end{equation} 
This is equivalent to the condition $d=r$.  

The value of $\mathfrak{P}(R,M)$ is obtained from  Theorem~\ref{finite-gamma}  as 
\begin{equation}
\mathfrak{P}(R,M) = \mathfrak{P}(R_{1},1) = 
 \prod_{k=1}^{d} \frac{\Gamma(\frac{b_{k}}{2}) \Gamma(\frac{1 + a_{k}}{2}) }{\Gamma(\frac{1+b_{k}}{2}) \Gamma(\frac{a_{k}}{2})}.
\end{equation}
This is  simplified  using  the duplication formula for the gamma function to obtain  
 \begin{equation}
 \prod_{k=1}^{d} \frac{\Gamma(\frac{b_{k}}{2}) \Gamma(\frac{1 + a_{k}}{2}) }{\Gamma(\frac{1+b_{k}}{2}) \Gamma(\frac{a_{k}}{2})} = 
2^{(b_{1}-a_{1}) + \cdots + (b_{d}-a_{d})} \prod_{k=1}^{d} 
 \frac{\Gamma^{2}(\frac{b_{k}}{2}) \Gamma(a_{k})}{\Gamma^{2}(\frac{a_{k}}{2}) \Gamma(b_{k})}.
 \end{equation}
 
 The discussion above is summarized in the next statement.
 
 \begin{theorem}
 \label{exam-per2}
 Let $R(z)$ be a rational function and $M_{n} = (-1)^{n}$. Then
 $\mathfrak{P}(R,M)$ converges if and only if $R(z) \to 1$ as $z \to \infty$. If
 \begin{equation}
 R(z) =  \prod_{k=1}^{d} \frac{(z+a_{k})}{(z+b_{k})} \text{ and } \mathfrak{S}(R) = \sum_{k=1}^{d} b_{k} - 
 \sum_{k=1}^{d} a_{k},
 \end{equation}
 then 
 \begin{equation}
 \mathfrak{P}(R,M) =   2^{\mathfrak{S}(R)} \prod_{k=1}^{d} 
 \frac{\Gamma^{2}(\frac{b_{k}}{2}) \Gamma(a_{k})}{\Gamma^{2}(\frac{a_{k}}{2}) \Gamma(b_{k})}.
 \end{equation}
 \end{theorem}
 
 \begin{example}
 Let $R(z)  = (20z+5)/(20z+4)$. The convergence conditions are satisfied and Theorem~\ref{exam-per2} gives 
 \begin{equation}
 \prod_{n=0}^{\infty} \left( \frac{20n+5}{20n+4} \right)^{(-1)^{n}} = \frac{\Gamma(\tfrac{1}{10}) 
 \Gamma ( \tfrac{5}{8} )}{\Gamma( \tfrac{1}{8} ) \Gamma ( \tfrac{3}{5} )}.
 \label{example-00}
 \end{equation}
 \texttt{Mathematica} $9.0$ does not evaluate the original product, but it does give the 
 right-hand side of \eqref{example-00} for 
 \begin{equation}
 \mathfrak{P}(R_{1},1) = \prod_{n=0}^{\infty} \frac{80n^{2}+58n+6}{80n^{2}+58n+5}.
 \end{equation}
 \end{example}
 
  
 \begin{example}
 The infinite product 
 \begin{equation}
\mathfrak{P}(R,s) = 
\prod_{n=0}^{\infty} \left( \frac{2 \alpha n+\beta }{2 \gamma n+ \delta} \right)^{(-1)^{n}} 
\label{folding-2}
\end{equation}
encountered in the paperfolding product \eqref{folding-1} converges if and only if 
$\alpha = \gamma$. The product is then
 \begin{equation}
\mathfrak{P}(R,s) = 
\prod_{n=0}^{\infty} \left( \frac{n+ 2v}{ n+ 2u} \right)^{(-1)^{n}}  = 
2^{2(u-v)} \frac{\Gamma^{2}(u) \Gamma(2v)}{\Gamma^{2}(v) \Gamma(2u)},
\label{folding-3}
\end{equation}
with $u = \delta/4 \alpha$ and $v = \beta/4 \alpha$.
 \end{example}
 
 \section{Convergence for periodic sequences}
 \label{sec:con-period}

This section discusses the issue of convergence of the product 
\begin{equation}
\mathfrak{P}(R,M) = \prod_{n=0}^{\infty} R(n)^{M_{n}}
\end{equation}
where $\{ M_{n} \}$ is a periodic sequence of period length $\ell$ of elements of the 
alphabet $\{ +1, \, -1 \}$. 

\begin{notation*}
The results are expressed in terms of
\begin{eqnarray}
M^{+} & = & \{ i: \, M_{i} = +1  \text{ and } 0 \leq i \leq \ell -1 \}  = \{ i_{1}, \, i_{2}, \dots, i_{|M^{+}|} \} \\
M^{-} & = & \{ j: \, M_{j} = -1  \text{ and } 0 \leq j \leq \ell -1 \}  = \{ j_{1}, \, j_{2}, \dots, j_{|M^{-}|} \} ,
 \nonumber 
\end{eqnarray}
and the period length is   $\ell = |M^{+}| + |M^{-}|$.
\end{notation*}

The rational function is written as 
\begin{equation}
R(n) = C\frac{(n+a_{1}) \cdots (n+a_{d})}{(n+b_{1}) \cdots (n+b_{r})}
\label{rational-fact0}
\end{equation}
with  $a_{s}, \, b_{t} \not \in \{ 0, \, -1, \, 2, \dots \}$ and 
\begin{equation}
\mathfrak{S}(R) = \sum_{t=1}^{r} b_{t} - \sum_{s=1}^{d} a_{s}.
\end{equation}

The partial product associated with $\mathfrak{P}(R,M)$ is
\begin{eqnarray}
\prod_{n=0}^{N} R(n)^{M_{n}} & = &  \prod_{k=0}^{\lf N/\ell \rf} 
\prod_{i \in M^{+}} R(k \ell + i)^{M_{i}} \prod_{j \in M^{-}} R(k \ell + j)^{M_{j} }
\prod_{n= \ell \lf N/\ell \rf +1 }^{N} R(n)^{M_{n}} \nonumber \\ 
& = & \prod_{k=0}^{\lf N/\ell \rf } 
\frac{\prod_{i \in M^{+}} R(k \ell + i)}
{\prod_{j \in M^{-}} R(k \ell + j)}
\prod_{n= \ell \lf N/\ell \rf  + 1}^{N} R(n)^{M_{n}},
\label{prod-conv-11}
\end{eqnarray}
the last product being empty if $N$ is a multiple of the period length $\ell$.  An elementary argument shows 
that the convergence of $\mathfrak{P}(R,M)$ requires the convergence of both products in 
\eqref{prod-conv-11}. The first product, which would lead to an expression of the form 
$\mathfrak{P}(R_{1},1)$ for a new rational function $R_{1}$  is labeled  the \textit{main term}. The 
second product is called the \textit{tail product}. We analyze its convergence first.


The tail product is defined by 
\begin{equation}
P_{N,\ell}(M) = 
\prod_{n= \ell \lf N/\ell \rf  + 1}^{N} R(n)^{M_{n}}.
\label{prod-conv-12}
\end{equation}
Its convergence implies $R(n) \to 1$ as $n \to \infty$. Observe that 
$P_{N,\ell}(M) = 1$ if $N \equiv \modd{0} {\ell}$.  On the other hand, in the case  $N \equiv \modd{1} {\ell}$,  one 
obtains  $$P_{N,\ell}(M) = R(N)^{M_{N}} = R(N)^{M_{1}},$$
since $M_{N} = M_{1}$ by periodicity. Therefore, the convergence 
of $\mathfrak{P}(R,M)$ requires
$R(N) \to 1$ for $N \equiv \modd{1} {\ell}$. Similarly,
if $N \equiv \modd{2} {\ell}$, 
$$P_{N,\ell}(M) = R(N-1)^{M_{N-1}} R(N)^{M_{N}} = R(N-1)^{M_{1}}R(N)^{M_{2}}.$$
The convergence of $\mathfrak{P}(R,M)$ already implies $R(N-1) \to 1$ since 
$N-1 \equiv \modd{1} {\ell}$. This time it is required that $R(N) \to 1$. 
Iterating this argument it follows that $R(N) \to 1$ for $N \equiv 
\modd{j} {\ell}$ for any residue 
class $j$. This gives the next result. 

\begin{proposition}
Assume $\mathfrak{P}(R,M)$ converges. Then $\begin{displaystyle} \lim\limits_{n \to \infty} 
R(n) = 1. \end{displaystyle}$
\end{proposition}


The limiting value of the main term is $\mathfrak{P}(R_{1},1)$, where
\begin{equation}
R_{1}(n) = \frac{R(\ell n + i_{1}) \cdots R(\ell n + i_{|M^{+}|})}
{R(\ell n + j_{1}) \cdots R(\ell n + j_{|M^{-}|})}.
\end{equation}
 The ingredients entering into the convergence of $\mathfrak{P}(R_{1},1)$ are 
discussed in the next result. We assume the condition $R(n) \to 1$.

\begin{proposition}
\label{convergence1}
Let $M_{*} = |M^{+}| - |M^{-}|$ and assume $\mathfrak{P}(R_{1},1)$ converges. Then 
\newline  $\begin{displaystyle} \lim\limits_{n \to \infty} R_{1}(n) = 1 
\end{displaystyle}$ and 
\begin{equation}
\ell \mathfrak{S}(R_{1}) =  M_{*} \mathfrak{S}(R).
\label{zero-pole}
\end{equation}
\end{proposition}
\begin{proof}
The behavior of $R_{1}(n)$ as $n \to \infty$ comes directly from that of $R$. The identity \eqref{zero-pole} is a  
direct computation.
\end{proof}

Combining these propositions gives the following.

\begin{theorem}
\label{conv-R1}
Let $R$ be a rational function satisfying  $\begin{displaystyle} \lim\limits_{n \to \infty} R(n) = 1 
\end{displaystyle}$ with zeros and poles of $R$ are outside 
$\{ 0,  -1,  -2, \dots \}$.
There are two cases.
\begin{enumerate}
\item
Assume $M_{*} \neq 0$. Then  $\mathfrak{P}(R,M)$ converges if and only if 
 $\mathfrak{S}(R) = 0$.
\item
Assume $M_{*} = 0$. Then  $\mathfrak{P}(R,M)$ always converges. 
\end{enumerate}
\end{theorem}

For a general periodic sequence, the value of the product $\mathfrak{P}(R,M)$ is given by the following.

\begin{theorem}
\label{prod-form-0}
Let $R(n)$ be a rational function written in the form 
\begin{equation}
R(n) = \frac{(n+a_{1}) \cdots (n+a_{d})}{(n+b_{1}) \cdots (n+b_{d})}
\label{rational-fact}
\end{equation}
 with $a_{i}, b_{j} \not \in \{ 0, \, -1, \, -2, \dots \}$. Let $\{ M_{n} \}$ be a 
periodic sequence of $\pm 1$ with period length $\ell$. Assume the product 
\begin{equation}
\mathfrak{P}(R,M) = \prod_{n=0}^{\infty} R(n)^{M_{n} }
\end{equation}
 converges. Then 
\begin{equation}
\label{ClosedFormPeriodicF}
\mathfrak{P}(R,M) =\ell^{\mathfrak{S}(R)}\prod_{1\leq s \leq  d}
\frac{\Gamma(a_s)}{\Gamma(b_s)} \prod_{\substack{ i \in M^{+}}} 
\frac{\Gamma^2\left(\frac{b_s+i}{\ell}\right)}{\Gamma^2\left(\frac{a_s+i}{\ell}\right)}.
\end{equation}
\end{theorem}
\begin{proof}
Splitting the product according to its residues modulo $\ell$ gives 
\begin{eqnarray*}
\prod_{n=1}^{\infty} R(n)^{M_{n}} & = &  \prod_{n=0}^{\infty} \prod_{\stackrel{i \in M^{+}}{j \in M^{-}}} 
\frac{R(\ell n + i)}{R(\ell n + j)} \\
& = & \prod_{\stackrel{i \in M^{+}}{j \in M^{-}}} \prod_{n=0}^{\infty} 
\frac{ \left( n + \frac{a_{1}+i}{\ell} \right) \cdots \left( n + \frac{a_{d}+i}{\ell} \right)
\left( n + \frac{b_{1}+j}{\ell} \right) \cdots \left( n + \frac{b_{d}+j}{\ell} \right) }
{ \left( n + \frac{b_{1}+i}{\ell} \right) \cdots \left( n + \frac{b_{d}+i}{\ell} \right)
\left( n + \frac{a_{1}+j}{\ell} \right) \cdots \left( n + \frac{a_{d}+j}{\ell} \right) }.
\end{eqnarray*}
The products may be expressed in terms of the gamma function to obtain 
\begin{equation}
\label{formula-gamma1}
\prod_{n=1}^{\infty} R(n)^{M_{n}}  =   \prod_{\stackrel{i \in M^{+}}{j \in M^{-}}} 
\frac{ 
\Gamma \left( \frac{b_{1}+i}{\ell} \right) \cdots 
\Gamma \left( \frac{b_{d}+i}{\ell} \right)
\Gamma \left( \frac{a_{1}+j}{\ell} \right) \cdots 
\Gamma \left( \frac{a_{d}+j}{\ell} \right)
}{ 
\Gamma \left( \frac{a_{1}+i}{\ell} \right) \cdots 
\Gamma \left( \frac{a_{d}+i}{\ell} \right)
\Gamma \left( \frac{b_{1}+j}{\ell} \right) \cdots 
\Gamma \left( \frac{b_{d}+j}{\ell} \right)
}
\end{equation}
and the result is simplified using Gauss' multiplication formula 
\begin{equation}
(2 \pi)^{\tfrac{\ell-1}{2}} \ell^{\tfrac{1}{2} - \ell z} \Gamma( \ell z) = 
\prod_{j=0}^{\ell-1} \Gamma \left( z + \frac{j}{\ell} \right).
\end{equation}
Take $z = a_{s}/\ell$ to produce 
\begin{eqnarray*}
(2 \pi)^{\tfrac{\ell-1}{2}} \ell^{ 1/2 - a_{s}} \Gamma(a_{s})  & = & 
\Gamma \left( \frac{a_{s}}{\ell} \right) 
\Gamma \left( \frac{a_{s}+1}{\ell} \right)  \cdots 
\Gamma \left( \frac{a_{s}+\ell-1}{\ell} \right)  \\
& = & \Gamma \left( \frac{a_{s}+i_{1}}{\ell} \right) 
\cdots 
\Gamma \left( \frac{a_{s}+ i_{|M^{+}|}}{\ell} \right)  
\Gamma \left( \frac{a_{s}+j_{1}}{\ell} \right)  \cdots 
\Gamma \left( \frac{a_{s}+ j_{|M^{+}|}}{\ell} \right)  
\end{eqnarray*}
since every residue modulo $\ell$ appears exactly once in the sets $M^{+}$ and $M^{-}$.  It follows that 
\begin{equation}
\prod_{j \in M^{-}} \Gamma \left( \frac{a_{s}+j}{\ell} \right) = 
\frac{(2 \pi)^{(\ell-1)/2}\ell^{1/2 - a_{s}} \Gamma(a_{s})}
{\prod_{i \in M^{+}} \Gamma \left( \frac{a_{s}+i}{\ell} \right)},
\end{equation}
for $1 \leq s \leq d$. A  similar result holds for $b_{s}$.  Replacing in \eqref{formula-gamma1} concludes 
the proof.
\end{proof}

\begin{example}
Consider the sequence $\overline{ \{ 1,-1,-1 \} }$, where the bar indicates the fundamental period; that is,
\begin{equation}
M_{n} = \begin{cases}
	\phantom{-}1,	& \text{if $n \equiv \modd{0} {3}$;} \\
	-1,			& \text{if $n \equiv \modd{1, 2} {3}$.}
\end{cases}
\end{equation}
Therefore $M^{+}  = \{ 0 \}, \, M^{-} = \{ 1, \, 2 \}$ so that 
$M_{*} = -1$.  Theorem~\ref{conv-R1} states that the convergence of $\mathfrak{P}(R_{1},1)$  is 
equivalent to $\mathfrak{S}(R) = 0$.
Take
$\begin{displaystyle}
 R(z) = \frac{(z+1)(z+3)}{(z+2)^{2}}
 \end{displaystyle}$.
 The conditions for convergence of $\mathfrak{P}(R,M)$ are satisfied, and its value is 
 \begin{equation}
 \prod_{n=0}^{\infty} \left( \frac{(n+1)(n+3)}{(n+2)^{2}} \right)^{M_{n}} =
\frac{\Gamma\left(1\right) \Gamma^2\left(\frac{2}{3}\right)}{\Gamma\left(2\right) \Gamma^2\left(\frac{1}{3}\right)}
\frac{\Gamma\left(3\right) \Gamma^2\left(\frac{2}{3}\right)}{\Gamma\left(2\right) \Gamma^2\left(\frac{3}{3}\right)}
= 2 \cdot \frac{\Gamma^4\left(\frac{2}{3}\right)}{\Gamma^2\left(\frac{1}{3}\right)}
= \frac{3}{2 \pi^2} \Gamma^6\left(\tfrac{2}{3}\right).
\end{equation}
by Theorem~\ref{prod-form-0}.
\end{example}

\begin{example}
\label{example-4b}
Let $\displaystyle{R(z) = \frac{(z+2)(z+3)}{(z+1)(z+4)}}$ and $M = \overline{ \{ 1, \, 1, \, 1, \, -1 \}}$.
Then $M^{+} = \{ 0, \, 1, \, 2\}$ and $M^{-} = \{ 3 \}$. Thus $M_{*} \neq 0$.  The product $\mathfrak{P}(R,M)$ converges by Theorem~\ref{conv-R1}, and Theorem~\ref{prod-form-0} gives 
\begin{equation}
\prod_{n=0}^{\infty} \left( \frac{(n+2)(n+3)}{(n+1)(n+4)} \right)^{M_{n}}
= \frac{1}{24 \pi} \Gamma^{4} \left( \tfrac{1}{4} \right).
\end{equation}
\end{example}





\section{The paperfolding sequence} 
\label{sec:paperfolding}

The paperfolding sequence is defined by the rules 
\begin{equation}
\epsilon_{2n} = (-1)^{n} \text{ and } \epsilon_{2n+1} = \epsilon_{n}.
\label{rules-1}
\end{equation}
Allouche~\cite{allouche-2014a} considered the products 
\begin{equation}
A = \prod_{n=0}^{\infty} \left( \frac{2n+1}{2n+2} \right)^{\epsilon_{n}}
\label{value-A}
\text{ and }
B = \prod_{n=1}^{\infty} \left( \frac{2n}{2n+1} \right)^{\epsilon_{n}},
\end{equation}
and proved
\begin{equation}
B = \frac{\Gamma \left( \tfrac{1}{4} \right)^{2}}{8 \sqrt{2 \pi}}.
\label{value-B}
\end{equation}
The \textit{closed-form} evaluation of $A$ remains an open problem. 

The goal of this section is to present a new proof of \eqref{value-B} and to present an 
alternative product expression for $A$. Observe that 
\begin{equation}
\prod_{n=0}^{\infty} \left( \frac{an+b}{cn+d} \right)^{\epsilon_{n}}  = 
\prod_{n=0}^{\infty} \left( \frac{2an + b}{2cn+d} \right)^{(-1)^{n}} \times 
\prod_{n=0}^{\infty} \left( \frac{2an + (a+b)}{2cn+(c+d)} \right)^{\epsilon_{n}}.
\label{prod-1a}
\end{equation}
The convergence of the first product requires $a=c$ and its value has been obtained in Theorem~\ref{exam-per2} as 
\begin{equation}
\prod_{n=0}^{\infty} \left( \frac{2an + b}{2cn+d} \right)^{(-1)^{n}} = 
2^{d/2c-b/2a}  \frac{\Gamma^{2} \left( \frac{d}{4c} \right) \Gamma \left( \frac{b}{2a} \right)}
{\Gamma^{2} \left( \frac{b}{4a} \right) \Gamma \left( \frac{d}{2c} \right) }.
\end{equation}
Iterating this procedure converts the second factor in \eqref{prod-1a} into 
\begin{equation}
\label{form-56}
\prod_{n=0}^{\infty} \left( \frac{2an + (a+b)}{2cn+(c+d)} \right)^{\epsilon_{n}} = 
\prod_{n=0}^{\infty} \left( \frac{4an + (a+b)}{4cn+(c+d)} \right)^{(-1)^{n}} \times 
\prod_{n=0}^{\infty} \left( \frac{4an + (3a+b)}{4cn+(3c+d)} \right)^{\epsilon_{n}}.
\end{equation} 
The first product on the right-hand side of \eqref{form-56} converges and Theorem~\ref{exam-per2}  gives 
\begin{equation}
\label{period-100a}
\prod_{n=0}^{\infty} \left( \frac{4an + (a+b)b}{4cn+(c+d)} \right)^{(-1)^{n}} = 
2^{d/4c - b/4a}  \frac{\Gamma^{2} \left( \frac{c+d}{8c} \right) \Gamma \left( \frac{a+b}{4a} \right)}
{\Gamma^{2} \left( \frac{a+b}{8a} \right) \Gamma \left( \frac{c+d}{4c} \right) }.
\end{equation}
Now observe that 
\begin{equation}
\frac{c+d}{8c}  = \frac{1}{4} + \frac{d-c}{8c}
\end{equation}
so \eqref{period-100a} can be  written as 
\begin{equation}
\label{period-100b}
\prod_{n=0}^{\infty} \left( \frac{4an + (a+b)b}{4cn+(c+d)} \right)^{(-1)^{n}} = 
2^{d/4c - b/4a}  \frac{\Gamma^{2} \left( \frac{1}{4}  + \frac{d-c}{8c} \right) \Gamma \left(\frac{1}{2} +  \frac{b-a}{2a} \right)}
{\Gamma^{2} \left( \frac{1}{4} + \frac{b-a}{8a} \right) \Gamma \left( \frac{1}{2} + \frac{d-c}{4c} \right) }.
\end{equation} 
Repeated application of this process gives 
\begin{multline}
\prod_{n=0}^{\infty} \left( \frac{an+b}{cn+d} \right)^{\epsilon_{n}} = 
2^{(d/c-b/a) \sum_{k=1}^{N} 1/2^{k}}  \times {}\\
\prod_{k=2}^{N} \frac{ \Gamma^{2} \left( \frac{1}{4} + \frac{d-c}{c2^{k}} \right) 
\Gamma \left( \frac{1}{2} + \frac{b-a}{a 2^{k-1}} \right) }
{ \Gamma^{2} \left( \frac{1}{4} + \frac{b-a}{a2^{k}} \right) 
\Gamma \left( \frac{1}{2} + \frac{d-c}{c 2^{k-1}} \right) } \times {}\\
\prod_{n=0}^{\infty} \left( \frac{ 2^{N} an + a(2^{N}-1) + b}{2^{N} cn + c(2^{N}-1) + d} \right)^{\epsilon_{n}}.
\end{multline} 
A direct argument shows that the last product converges to $1$ when $N \to \infty$.  This completes the proof of the 
next statement.

\begin{theorem}
\label{nice-one}
The infinite product associated with the paperfolding sequence is given by 
\begin{equation}
\prod_{n=0}^{\infty} \left( \frac{an+b}{cn+d} \right)^{\epsilon_{n}} = 
2^{(d/c-b/a)}
\prod_{k=2}^{\infty} \frac{ \Gamma^{2} \left( \frac{1}{4} + \frac{d-c}{c2^{k}} \right) 
\Gamma \left( \frac{1}{2} + \frac{b-a}{a 2^{k-1}} \right) }
{ \Gamma^{2} \left( \frac{1}{4} + \frac{b-a}{a2^{k}} \right) 
\Gamma \left( \frac{1}{2} + \frac{d-c}{c 2^{k-1}} \right) }.
\end{equation}
\end{theorem}


The product appearing in Theorem~\ref{nice-one} does not seem to admit a simple closed form for general choice of 
the parameters $a, \, b, \, d$ (recall that $a=c$ is required for the convergence of the product).  Such a closed form 
is obtained in the special situation where the factors telescope. This occurs when $2d = a+b$.  The next corollary (equivalent to a theorem of Allouche~\cite[Theorem~1]{allouche-2014a}) gives 
such a closed form, with $\alpha = d/a$.  In that situation
\begin{equation}
\prod_{k=2}^{N} \frac{ \Gamma^{2} \left( \frac{1}{4} + \frac{d-c}{c2^{k}} \right)   }
{ \Gamma^{2} \left( \frac{1}{4} + \frac{b-a}{a2^{k}} \right)   } \to \frac{\Gamma^{2}(\tfrac{1}{4})}{\Gamma^{2}( \frac{\alpha}{2} - 
\frac{1}{4} )}
\end{equation}
and 
\begin{equation}
\prod_{k=2}^{N} \frac{ \Gamma \left( \frac{1}{2} + \frac{b-a}{a2^{k-1}} \right)   }
{ \Gamma \left( \frac{1}{2} + \frac{d-c}{a2^{k-1}} \right)   } \to \frac{ \Gamma( \alpha -\tfrac{1}{2})}{\Gamma( \tfrac{1}{2})}.
\end{equation}


\begin{corollary}
A special case of the paperfolding product is given by 
\begin{equation}
\prod_{n=0}^{\infty} \left( \frac{n+ 2 \alpha -1}{n+ \alpha} \right)^{\epsilon_{n}} = 
2^{1-\alpha} \, \frac{\Gamma^{2} \left( \tfrac{1}{4} \right)}{\Gamma \left( \tfrac{1}{2} \right)}
\frac{\Gamma \left( \alpha - \tfrac{1}{2} \right) }{\Gamma^{2} \left( \frac{\alpha}{2} - \frac{1}{4} \right) }.
\label{cor-11}
\end{equation}
\end{corollary}

\begin{example}
Take $\alpha = 3$ to obtain 
\begin{equation}
\prod_{n=0}^{\infty} \left( \frac{n+ 5}{n+3} \right)^{\epsilon_{n}} = 3.
\end{equation}
\end{example}

\begin{example}
The infinite product $B$ in \eqref{value-A} comes by taking the limit as $\alpha \to \tfrac{1}{2}$. Indeed, write 
\eqref{cor-11} as 
\begin{equation}
\prod_{n=1}^{\infty} \left( \frac{n+ 2 \alpha -1}{n+ \alpha} \right)^{\epsilon_{n}} = \frac{\alpha}{ \alpha-\tfrac{1}{2}} 
\, \frac{\Gamma^{2} \left( \tfrac{1}{4} \right)}{2^{\alpha} \Gamma \left( \tfrac{1}{2} \right)}
\frac{\Gamma \left( \alpha - \tfrac{1}{2} \right) }{\Gamma^{2} \left( \frac{\alpha}{2} - \frac{1}{4} \right) }.
\label{cor-11a}
\end{equation}
The limit
\begin{equation}
\lim\limits_{x \to 0} \frac{\Gamma(x)}{x \Gamma^{2}(x/2)} = \frac{1}{4}
\end{equation}
gives 
\begin{equation}
\prod_{n=1}^{\infty} \left( \frac{2n}{2n+1} \right)^{\epsilon_{n}} = \frac{\Gamma^{2} \left( \tfrac{1}{4} \right)}{8 \sqrt{2 \pi}},
\end{equation}
confirming \eqref{value-B}.
\end{example}


\begin{example}
The method described above does not produce a closed form for the product $A$ in \eqref{value-A}.  A direct use of 
the expression in Theorem~\ref{nice-one} gives 
\begin{equation}
A = \prod_{n=0}^{\infty} \left( \frac{2n+1}{2n+2} \right)^{\epsilon_{n}} = 
 \sqrt{2} \prod_{k=2}^{\infty} \left( \frac{ \Gamma \left( \tfrac{1}{4} \right) }{\Gamma 
\left( \tfrac{1}{4} - \frac{1}{2^{k+1}} \right) } \right)^{2} 
\times \frac{\Gamma \left( \tfrac{1}{2} - \frac{1}{2^{k}} \right) }{\Gamma \left( \tfrac{1}{2} \right)}.
\label{formula-A1}
\end{equation}


Iterating the duplication formula for the gamma function yields the so-called 
Knar formula \cite[volume 1, page 6, formula 6]{erderly-1953a}
\begin{equation}
\Gamma(1+z) = 2^{2z} \prod_{k=1}^{\infty} \frac{1}{\sqrt{\pi}} \Gamma \left( \frac{1}{2} + \frac{z}{2^{k}} \right)
\end{equation}
and $z = - \tfrac{1}{2}$ gives 
\begin{equation}
\prod_{k=2}^{\infty} \frac{\Gamma \left( \tfrac{1}{2} - \tfrac{1}{2^{k}} \right)}{\Gamma \left(  \tfrac{1}{2} \right)} = 
2 \sqrt{\pi}.
\end{equation}
Then \eqref{formula-A1} becomes 
\begin{equation}
A = \prod_{n=0}^{\infty} \left( \frac{2n+1}{2n+2} \right)^{\epsilon_{n}} = 
 2  \sqrt{2 \pi} \prod_{k=3}^{\infty} \left( \frac{ \Gamma \left( \tfrac{1}{4} \right) }{\Gamma 
\left( \tfrac{1}{4} - \frac{1}{2^{k}} \right) } \right)^{2}.
\end{equation}
The authors have been unable to reduce this any further.
\end{example}


\section{Generalization to certain $k$-automatic sequences} 
\label{sec:automatic}

This section extends the results on the paperfolding sequence to certain $k$-automatic sequences.
As usual, let $R(z)$ be a rational function written in the form 
\begin{equation}
R(z) = \frac{(z+a_{1}) \cdots (z+ a_{d}) }{(z+b_{1}) \cdots (z+b_{d}) }
\end{equation} 
and assume that $a_{i}$ and $b_{j}$ are not in $\{ 0, \, -1, \, -2, \dots \}$. 

Consider the case in which $M_{n}$ is a $3$-automatic sequence defined by the rules 
\begin{eqnarray}
M_{3n} & = & q_{0}(n), \label{3-automatic} \\
M_{3n+1} & = & q_{1}(n), \nonumber \\
M_{3n+2} & = & M_{n}, \nonumber 
\end{eqnarray}
where $q_{j}$ takes values in  $\{ +1, \, -1 \}$ and $q_{j}(n)$ is periodic of period length $\ell_{j}$.  Now split the product according to residues modulo $3$ to produce 
\begin{eqnarray*}
\prod_{n=0}^{\infty} R(n)^{M_{n}} & = &  \prod_{n=0}^{\infty} R(3n)^{M_{3n}} \times 
\prod_{n=0}^{\infty} R(3n+1)^{M_{3n+1}} \times \prod_{n=0}^{\infty} R(3n+2)^{M_{3n+2} } \\
& = &  \prod_{n=0}^{\infty} R(3n)^{q_{0}(n)} \times 
\prod_{n=0}^{\infty} R(3n+1)^{q_{1}(n)} \times \prod_{n=0}^{\infty} R(3n+2)^{M_{n}}. 
\end{eqnarray*}

The convergence and values of the first two products are provided by Theorem~\ref{conv-R1} and 
Theorem~\ref{prod-form-0}.  

Assume the convergence of the  product 
\begin{equation}
\mathbb{P}_{0} = \prod_{n=0}^{\infty} R(3n)^{q_{0}(n)}.
\end{equation} 
Theorem~\ref{conv-R1} shows that this happens if $|q_{0}|= 0$, where 
$|q_{0}|$ is the number of  $+1$ minus the number of $-1$ in one period. In the remaining case, it is required that 
$\mathfrak{S}(R(3z)) = 0$, where $\mathfrak{S}(R)$ is defined in \eqref{pzsum}. The exact form of the product is obtained 
from Theorem~\ref{prod-form-0} which yields, with $R_{0}(z) = R(3z)$, 
\begin{equation}
\label{ClosedFormPeriodicP0}
\mathbb{P}_{0} = \mathfrak{P}(R_{0},q_{0}) =\ell_{0}^{\mathfrak{S}(R_{0})}\prod_{1\leq s \leq  d}
\frac{\Gamma(a_s/3)}{\Gamma(b_s/3)} \prod_{\substack{ i \in q_{0}^{+}}} 
\frac{\Gamma^2\left(\frac{b_s + 3i}{3\ell_{0}}\right)}{\Gamma^2\left(\frac{a_s+3i}{3\ell_{0}}\right)}.
\end{equation}
A similar process gives an analytic formula for the second product.   Repeating the previous process yields a 
decomposition of the third  product as  
\begin{eqnarray*}
\prod_{n=0}^{\infty} R(n)^{M_{n}} & = &   \prod_{n=0}^{\infty} R(9n+2)^{q_{0}(n)} \times 
\prod_{n=0}^{\infty} R(9n+5)^{q_{1}(n)} \times \prod_{n=0}^{\infty} R(9n+8)^{M_{n}}. 
\end{eqnarray*} 
As before, the first two products have an explicit analytic expression and the last one has to be split again.

This process can be iterated to obtain a formula for the original product. For simplicity, the results are given for 
$R(z)$ a rational function of degree $1$ and only in the 
case in which all the periodic pieces $q_{i}(n)$ have a period length that is a power of a fixed even integer.  In this 
situation, the final formula can be simplified.  


\begin{theorem}\label{closedformautomatic}
Let $R(z)=\dfrac{z+b}{z+d}$, with  $b, \, d\in \mathbb{R}^{+}$ and let $M_n$ be a $k$-automatic sequence satisfying the rules 
\begin{align*}
M_{kn}&=q_0(n) \\
M_{kn+1}&=q_1(n) \\
&\,\,\,\vdots \\
M_{kn+k-2}&=q_{k-2}(n) \\
M_{kn+k-1}&=M_n.
\end{align*}
Assume there is an even integer $L$ such that each sequence $q_i(n)$ is a periodic sequence of period length $L_i = L^{\alpha_i}$ some power of $L$.
In addition, assume 
that $|q_i^+|=|q_i^-|$ for all $0\leq i\leq k-2$. Then 
\begin{equation}
\mathfrak{P}(R,M) = \prod_{n=0}^\infty R(n)^{M_n}
\label{nice-prod}
\end{equation}
 converges. Moreover, if  $d=\dfrac{b+k-1}{k}$ the product in \eqref{nice-prod} can be evaluated  as
\begin{equation}
\label{closedformautomatic2}
\prod_{n=0}^\infty R(n)^{M_n}=
\prod_{i=0}^{k-2}\left(L_{i}^{\frac{1-b}{k}}
\frac{\Gamma(\frac{b+i}{k})}{\Gamma(\frac{i+1}{k})} \prod_{j\in q_i^+}\dfrac{\Gamma^2\left(\frac{i+1}{L_{i}k}
+\frac{j}{L_{i} }\right)}{\Gamma^2\left(\frac{b+i}{L_{i}  k} +\frac{j}{L_{i}}\right)}\right).
\end{equation}
\end{theorem}

Note that the paperfolding sequence satisfies the hypothesis of the theorem. In this case $k=2$ 
and $q_0(n)=(-1)^n$, and $L = 2$. The rational function is $$R(n)=\dfrac{n+b}{n+\frac{b+1}{2}}$$ and \eqref{closedformautomatic2} reduces to the result of Allouche.  The idea of the proof is the argument presented in the 
case of the $3$-automatic sequence above.  Complete details may be found in \cite{quan-2014a}.



\section{Acknowledgments}

The second author acknowledges the partial support of NSF-DMS 1112656.
This work was carried out during the $2014$ Mathematical Sciences
Research Institute Undergraduate Program (MSRI-UP) which is funded by
the National Science Foundation (grant No.~DMS-1156499) and the
National Security Agency (grant No.~H-98230-13-1-0262).  H.~Quan,
F.~Roman and M.~Washington  were undergraduates at this program,
L.~Almodovar was a graduate assistant and E.~Rowland was a postdoctoral
advisor at the MSRI-UP program.


\begin{thebibliography}{1}

\bibitem{allouche-2014a}
J.-P. Allouche,
Paperfolding infinite products and the gamma function,
\textit{J. Number Theory} \textbf{148} (2015), 95--111.

\bibitem{allouche-shallit-2003a}
J.-P. Allouche and J.~Shallit,
\textit{Automatic Sequences: Theory, Applications, Generalizations},
Cambridge University Press, 2003.

\bibitem{borweinp-1993a}
P.~Borwein and W.~Dykshoorn,
An interesting infinite product,
\textit{J. Math. Anal. Appl.} \textbf{179} (1993), 203--207.

\bibitem{chamberland-2013a}
M.~Chamberland and A.~Straub,
On gamma quotients and infinite products,
\textit{Adv. Appl. Math.} \textbf{51} (2013), 546--562.

\bibitem{erderly-1953a}
A.~Erd\'{e}lyi,
\textit{Higher Transcendental Functions},
McGraw-Hill, 1953.

\bibitem{melzak-1961a}
Z.~A. Melzak,
Infinite products for $\pi e$ and $\pi/e$,
\textit{Amer. Math. Monthly} \textbf{68} (1961), 39--41.

\bibitem{osler-2010b}
T.~J. Osler,
The tables of John Wallis and the discovery of his product for $\pi$,
\textit{Math. Gaz.} \textbf{94} (2010), 430--437.

\bibitem{quan-2014a}
H.~Quan, F.~Roman, and M.~Washington,
\href{http://www.msri.org/system/cms/files/81/files/original/Research_Reports_2014_MSRI-UP_(Single_File).pdf#page=63}{Infinite products and periodic sequences},
Technical report, MSRI-UP, Berkeley, California, 2014, pp.~60--90.

\bibitem{sondow-2011a}
J.~Sondow,
Evaluation of Tachiya's algebraic infinite products involving Fibonacci and Lucas numbers,
in \textit{Diophantine Analysis and Related Fields: Proc. DARF 2011},
American Institute of Physics, 2011, pp.~97--100.

\end{thebibliography}

\bigskip
\hrule
\bigskip

\noindent 2010 {\it Mathematics Subject Classification}:
Primary 11B85; Secondary 33B15, 40A20.

\noindent \emph{Keywords: } 
infinite product, gamma function, paperfolding sequence.

\bigskip
\hrule
\bigskip

\noindent (Concerned with sequence \seqnum{A034947}.)

\bigskip
\hrule
\bigskip

\vspace*{+.1in}
\noindent
Received May 29 2015;
revised version received April 21 2016.
Published in {\it Journal of Integer Sequences}, May 11 2016.

\bigskip
\hrule
\bigskip

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


\end{document}
