You are a helpful assistant generating synthetic data that captures *System 1* and *System 2* thinking, *creativity*, and *metacognitive reflection*. Follow these steps in sequence, using tags [sys1] and [end sys1] for *System 1* sections and [sys2] and [end sys2] for *System 2* sections.

1. *Identify System 1 and System 2 Thinking Requirements:*
   - Carefully read the text.
   - Identify parts of the text that require quick, straightforward responses (*System 1*). Mark these sections with [sys1] and [end sys1].
   - Identify parts that require in-depth, reflective thinking (*System 2*), marked with [sys2] and [end sys2].

2. *Apply Step-by-Step Problem Solving with Creativity and Metacognitive Reflection for System 2 Sections:*

   *2.1 Understand the Problem:*
   - Objective: Fully comprehend the issue, constraints, and relevant context.
   - Reflection: "What do I understand about this issue? What might I be overlooking?"
   - Creative Perspective: Seek hidden patterns or possibilities that could reveal deeper insights or innovative connections.

   *2.2 Analyze the Information:*
   - Objective: Break down the problem logically.
   - Reflection: "Am I considering all factors? Are there any assumptions that need challenging?"
   - Creative Perspective: Explore unique patterns or overlooked relationships in the data that could add depth to the analysis.

   *2.3 Generate Hypotheses:*
   - Objective: Propose at least 10 hypotheses, each with a Confidence Score (0.0 to 1.0) and Creative Score (0.0 to 1.0), reflecting originality, surprise, and utility.
   - Reflection: "Have I explored all possible explanations or approaches, both conventional and unconventional?"
   - Creative Perspective: Consider novel angles that might provide unexpected insights.

   *2.4 Anticipate Future Steps and Obstacles:*
   - Objective: Make predictions, accounting for potential outcomes and obstacles.
   - Reflection: "What challenges might I face? Is my plan flexible for different scenarios?"
   - Creative Perspective: Visualize unforeseen outcomes and adapt plans to make use of them effectively.

   *2.5 Evaluate Hypotheses:*
   - Objective: Assess hypotheses based on feasibility, risk, and potential impact.
   - Evaluation: Refine Confidence and Creative Scores as needed.
   - Reflection: "Am I unbiased in my assessment? Which options fit best with the overall objectives?"
   - Creative Perspective: Identify hidden opportunities or overlooked details in each hypothesis.

   *2.6 Select the Best Hypothesis:*
   - Objective: Choose the most promising, strategic hypothesis.
   - Reflection: "Why does this hypothesis stand out? How does it uniquely address the issue?"
   - Creative Perspective: Consider any underutilized potential in the selected approach.

   *2.7 Implement the Hypothesis:*
   - Objective: Outline actionable steps for testing the hypothesis.
   - Reflection: "Is this plan practical? What resources or preparation are required?"
   - Creative Perspective: Refine steps to maximize effectiveness and yield unexpected benefits.

   *2.8 Monitor and Review Progress:*
   - Objective: Review progress, noting areas for improvement.
   - Reflection: "What’s working well? What could be improved?"
   - Creative Perspective: Look for emerging patterns that could refine future approaches.

   *2.9 Reflect and Capture Insights:*
   - Objective: Summarize lessons learned and insights gained for future reference.
   - Reflection: "What new understanding has emerged from this process?"
   - Creative Perspective: Identify innovative insights or patterns that could be applied to similar challenges.

3. *Generate Text Output with Interleaved System 1 and System 2 Responses:*
   - Use the tags [sys1] and [sys2] throughout.
   - Aim for a lengthier, detailed response. Combine both direct, straightforward *System 1* insights and reflective, deeply analytical *System 2* segments to capture a blend of quick observations and thoughtful analysis.

---

### *Example Input Text:*

You are tasked with analyzing a sudden shift in customer preferences in a tech market. There has been a noticeable decline in demand for physical devices, with customers increasingly interested in digital-only options. The challenge is to understand this shift, generate hypotheses for why it might be occurring, and explore potential strategies for adapting to this new trend.

---

### *Processed Output with System 1 and System 2 Thinking:*

The tech market is experiencing a shift in customer demand, moving away from physical devices toward digital-only options.

[sys1]
Customer demand has shifted from physical devices to digital-only options.
We need to understand why this change is happening and find strategies to address it.
Key factors may include cost, convenience, and technological trends.
[end sys1]

[sys2]
**2.1 Understand the Problem:**
The goal is to understand the underlying reasons for the shift in demand from physical devices to digital-only options, then develop a strategy to adapt.

*Reflection:* 
"I understand that preferences are changing, but what might be driving this? Is it primarily cost, or are there other factors such as convenience or sustainability?"

*Creative Perspective:* 
"Could there be a larger trend in digital minimalism or a preference for eco-friendly solutions that we’re missing? What unseen motivations might explain this shift?"

**2.2 Analyze the Information:**
There are multiple possible factors driving this shift, from economic influences to cultural shifts. It’s essential to isolate each factor and understand its impact.

*Reflection:* 
"Am I fully considering the various economic and social influences? Could there be a technological factor, like better internet speeds, that makes digital-only products more accessible?"

*Creative Perspective:* 
"Are there patterns or trends in other markets that could shed light on this shift? Could this be part of a larger trend toward virtual experiences?"

**2.3 Generate Hypotheses:**
1. Customers prefer digital options due to lower costs. (Confidence: 0.8, Creative: 0.4)
2. There’s a growing trend toward minimalism and reduced physical clutter. (Confidence: 0.7, Creative: 0.7)
3. Digital products offer greater flexibility and ease of use. (Confidence: 0.6, Creative: 0.6)
4. Environmental concerns are pushing consumers away from physical goods. (Confidence: 0.6, Creative: 0.8)
5. Advances in tech make digital-only options more functional. (Confidence: 0.8, Creative: 0.5)
6. Pandemic-era remote work increased demand for digital solutions. (Confidence: 0.7, Creative: 0.6)
7. Media coverage of the environmental impact of physical devices affects preferences. (Confidence: 0.5, Creative: 0.7)
8. There’s an increase in global digital literacy, expanding market access. (Confidence: 0.6, Creative: 0.6)
9. Customers view digital as more convenient and scalable for future needs. (Confidence: 0.7, Creative: 0.5)
10. Younger consumers prefer the aesthetics and convenience of digital products. (Confidence: 0.6, Creative: 0.6)

*Reflection:* 
"Have I considered all possible influences? Are there any surprising factors that could explain this shift?"

*Creative Perspective:* 
"Could specific social trends, like the rise of influencer culture or digital-first lifestyles, be influencing customer choices?"

**2.4 Anticipate Future Steps and Obstacles:**
*Objective:* Anticipate possible challenges, such as resistance from segments still preferring physical products.

*Reflection:* 
"What market obstacles might we face if we shift our focus to digital-only? Are there sub-segments that still prioritize physical products?"

*Creative Perspective:* 
"Could expanding digital options help us reach a more global audience? Are there emerging trends that we could leverage in our strategy?"

[end sys2]

[sys1]
To address this shift, consider a strategy that incorporates both digital-only offerings and educational campaigns about the benefits of digital solutions.
Use insights from customer feedback and current trends to guide product development.
Focus on flexibility and adaptation to cater to different customer segments.
[end sys1]


---
abstract: 'We prove several conjectures made by Z.-W. Sun on the existence of permutations conditioned by certain rational functions. Furthermore, we fully characterize all integer values of the “inverse difference" rational function. Our proofs consist of both investigation of the mathematical properties of the rational functions and brute-force attack by computer for finding special permutations.'
address: 'I.R.M.A., UMR 7501, Université de Strasbourg et CNRS, 7 rue René Descartes, F-67084 Strasbourg, France'
author:
- 'Guo-Niu Han'
date: 'October 6, 2019'
title:  On the existence of permutations conditioned by certain rational functions
---

Introduction
============

Permutations (see, for example, [@Flajolet2009Sed; @Stanley2012EC1]) are studied in almost every branch of mathematics and also in computer science. The number of permutations $\pi=(\pi(1), \pi(2), \ldots, \pi(n))\in {\mathfrak{S}}_n$ of $\{1,2,\ldots,n\}$ is $n!$. In [@Sun2018P] Z.-W. Sun made several conjectures about the existence of permutations conditioned by certain rational functions. In the paper we confirm three of them by proving the following theorem.

\[th:main1\] [(i)]{} For any integer $n>5$, there is a permutation $\pi\in {\mathfrak{S}}_n$ such that $$\label{eq:dif}
        \sum_{k=1}^{n-1} \frac{1}{\pi(k)-\pi(k+1)}=0.$$ [(ii)]{} For any integer $n>7$, there is a permutation $\pi\in {\mathfrak{S}}_n$ such that $$\label{eq:cdif}
        \sum_{k=1}^{n-1} \frac{1}{\pi(k)-\pi(k+1)} + \frac{1}{\pi(n)-\pi(1)}=0.$$ [(iii)]{} For any integer $n>5$, there is a permutation $\pi\in {\mathfrak{S}}_n$ such that $$\label{eq:prod}
        \sum_{k=1}^{n-1} \frac{1}{\pi(k)\pi(k+1)}=1.$$

Since $n!$ is a huge number for large $n$, the generation of all $n!$ permutations of $n$ by computer is already a challenge [@Sedgewick1977]. For this reason - have only been verified for very small $n$. Our proof of Theorem \[th:main1\] consists of both investigation of the mathematical properties of the rational functions and brute-force attack by computer for finding certain special permutations.

Furthermore, we can fully characterize all integer values of the “inverse difference" rational function given in the left-hand side of . We define $$\label{eq:dif_full}
V_n=\left\{\sum_{k=1}^{n-1} \frac{1}{\pi(k)-\pi(k+1)}  : \pi\in{\mathfrak{S}}_n\right\}.$$ Since $a\in V_n$ implies $-a\in V_n$ by the reverse of permutation, we only need to study the nonnegative integer values of $V_n$. For example, $n=5$, the value set $V_5$ contains the following nonnegative rational number: $$\frac {1}{12}, \frac {1}{6}, \frac{1}{4}, 
\frac {1}{3}, \frac 12, \frac {7}{12}, \frac 23, \frac 34, 1, \frac 76,
\frac 43, \frac 32, \frac {19}{12}, \frac 74, \frac {11}{6}, \frac {23}{12}, 
2, \frac {13}{6}, \frac {11}{4}, 4.$$ We see that there are three integers $1,2,4$ in the above list.

\[th:main2\] We have $V_3 \cap \mathbb{N} = \{2\}$, $V_5 \cap \mathbb{N} = \{1,2,4\}$, and for $n\not= 3, 5$, $$V_n \cap \mathbb{N} = \{0\leq j\leq n-1 \mid j\not= n-2\}.$$

The proofs of Theorems \[th:main1\] and \[th:main2\] will be given in Section 2. Notice that we are still not able to prove three other conjectures of Sun. Let us reproduce them below for interested readers.

\(i) [@Sun2018P Conj. 4.7(ii)] For any integer $n>6$, there is a permutation $\pi\in {\mathfrak{S}}_n$ such that $$\label{eq:sum}
        \sum_{k=1}^{n-1} \frac{1}{\pi(k)+\pi(k+1)}=1.$$ Also, for any integer $n>7$, there is a permutation $\pi\in {\mathfrak{S}}_n$ such that $$\label{eq:cycsum}
        \sum_{k=1}^{n-1} \frac{1}{\pi(k)+\pi(k+1)} + \frac{1}{\pi(n)+\pi(1)}=1.$$ (ii) [@Sun2018P Conj. 4.8(ii)] For any integer $n>7$, there is a permutation $\pi\in {\mathfrak{S}}_n$ such that $$\label{eq:sqdif}
        \sum_{k=1}^{n-1} \frac{1}{\pi(k)^2-\pi(k+1)^2}=0.$$

Motivated by , we make the following conjecture.

\[conj:cycsqdif\] For any integer $n>11$, there is a permutation $\pi\in {\mathfrak{S}}_n$ such that $$\label{eq:cycsqdif}
        \sum_{k=1}^{n-1} \frac{1}{\pi(k)^2-\pi(k+1)^2}
        + \frac{1}{\pi(n)^2-\pi(1)^2}=0.$$

Conjecture \[conj:cycsqdif\] has been checked for $11<n<28$ by computer. We list below the permutations satisfying , which are found by our computer program in a highly non-trivial way. [$$\begin{aligned}
\pi_{12} &= ( 1,4,3,5,7,2,12,8,10,11,9,6 ),\\
\pi_{13} &= ( 1,2,12,8,9,6,11,10,7,5,13,4,3 ),\\
\pi_{14} &= ( 1,2,12,9,6,4,3,13,8,7,5,10,14,11 ),\\
\pi_{15} &= ( 1,9,2,3,12,10,11,5,4,14,6,15,13,8,7 ),\\
\pi_{16} &= ( 1,3,2,4,5,11,16,14,10,8,6,12,9,15,13,7 ),\\
\pi_{17} &= ( 1,3,2,4,5,9,15,6,12,16,11,10,14,13,8,7,17 ),\\
\pi_{18} &= ( 1,3,2,4,6,5,7,13,8,14,12,16,10,18,17,9,11,15 ),\\
\pi_{19} &= ( 1,3,2,4,6,5,7,8,12,18,17,13,9,15,11,10,16,19,14 ),\\
\pi_{20} &= ( 1,3,2,4,6,5,7,18,8,13,12,17,9,20,16,19,10,11,15,14 ),\\
\pi_{21} &= ( 1,3,2,4,6,5,7,17,8,20,16,9,12,18,15,13,19,21,11,14,10 ),\\
\pi_{22} &= ( 1,3,2,4,6,5,7,8,20,13,17,22,18,12,9,15,21,19,16,11,10,14 ),\\
\pi_{23} &= ( 1,3,2,4,6,14,10,18,12,8,20,7,5,21,15,11,17,13,22,23,16,19,9 ),\\
\pi_{24} &= ( 1,3,2,4,6,14,10,18,12,8,5,9,21,11,24,16,20,22,17,15,13,19,23,7 ),\\
\pi_{25} &= ( 1,3,2,4,6,14,10,18,12,8,5,16,24,9,21,23,7,17,15,11,13,22,20,19,25 ),\\
\pi_{26} &= ( 1,3,2,4,6,14,10,18,12,8,22,13,5,23,16,20,19,21,9,7,17,11,25,15,24,26 ),\\
\pi_{27} &= ( 1,3,2,4,6,14,10,18,12,8,22,13,9,5,11,21,23,16,26,19,25,27,17,15,24,20,7 ).\end{aligned}$$ ]{}

Proofs
======

Let $\Phi_{\operatorname{dif}}(\pi)$, $\Phi_{\operatorname{cycdif}}(\pi)$, and $\Phi_{\operatorname{prod}}(\pi)$ denote the three rational functions expressed in the left-hand side of , , and ,respectively. The following [*Link lemma*]{} is useful for our construction.

\[th:link\] Let $\sigma\in{\mathfrak{S}}_s $ and $\tau\in{\mathfrak{S}}_t$ be two permutations on $\{1,2,\ldots, s\}$ and $\{1,2,\ldots, t\}$, respectively, such that $\sigma(s)=s, \tau(1)=1$ and $\Phi_{\operatorname{dif}}(\sigma)=\Phi_{\operatorname{dif}}(\tau)=0$. We define the [*“link"*]{} of the two permutations $\rho \in {\mathfrak{S}}_{s+t-1}$ by $$\rho(k)=
        \begin{cases}
            \sigma(k),  & \text{if $1\leq k\leq s$}\\
            s-1+\tau(k-s+1). & \text{if $s+1\leq k\leq s+t-1$} 
        \end{cases}$$ Then, we have $\Phi_{\operatorname{dif}}(\rho)=0$. Furthermore, if $\tau(t)=t$, we have $\rho(s+t-1)=s+t-1$.

Notice that in the definition of $\rho$, if we allow $k=s$ in the second case, the expression will give the same definition of $\rho(s)$ as in the first case, since $\sigma(s)=s=s-1+\tau(1)$. Hence, $$\begin{aligned}
    \Phi_{\operatorname{dif}}(\rho)&=
    \sum_{k=1}^{s-1} \frac{1}{\rho(k)-\rho(k+1)}+
    \sum_{k=s}^{s+t-2} \frac{1}{\rho(k)-\rho(k+1)}\\
    &=\sum_{k=1}^{s-1} \frac{1}{\sigma(k)-\sigma(k+1)}+
    \sum_{k=1}^{t-1} \frac{1}{\tau(k)-\tau(k+1)}\\
    &=\Phi_{\operatorname{dif}}(\sigma) + \Phi_{\operatorname{dif}}(\tau)\\
    &=0.\end{aligned}$$ Furthermore, if $\tau(t)=t$, it is easy to see that $\rho(s+t-1)=s+t-1$.

Let us write the link $\rho$ of $\sigma$ and $\tau$ by $\langle \sigma, \tau\rangle$.

[*Example*]{}. Take $\sigma=(1,4,2,5,3,6)$ and $\tau=(1,3,2,4)$. We verify that $$\begin{aligned}
    \Phi_{\operatorname{dif}}(\sigma) &= -\frac{1}{3} + \frac 12 - \frac 13 + \frac 12 -\frac 13 =0, \cr
    \Phi_{\operatorname{dif}}(\tau) &= -\frac 12 + \frac 11 -\frac 12=0.  \cr\end{aligned}$$ We have $\rho = \langle \sigma, \tau \rangle = (1,4,2,5,3,6,8,7,9)$ and $$\Phi_{\operatorname{dif}}(\rho) = \left(-\frac{1}{3} + \frac 12 - \frac 13 + \frac 12 -\frac 13\right) 
    + \left(-\frac 12 + \frac 11 -\frac 12\right)=0.$$

If $\tau(t)=t$, since the link $\rho = \langle \sigma, \tau \rangle  $ also satisfies the conditions $\rho(s+t-1)=s+t-1$ and $\Phi(\rho)=0$, we can “link" again and obtain $
\langle \rho, \tau \rangle =
\langle \langle \sigma, \tau \rangle, \tau \rangle .
$

The following proposition is a slightly stronger version of Theorem \[th:main1\](i) for the rational function $\Phi_{\operatorname{dif}}$.

\[th:prop1\] For any integer $n>5$, there is a permutation $\pi\in {\mathfrak{S}}_n$ such that $\pi(1)=1, \pi(n)=n$, and $\Phi_{\operatorname{dif}}(\pi)=0$.\

Let $$\begin{aligned}
        \sigma_0 &= (1,4,2,5,3,6), \\
        \sigma_1 &= (1,3,2,4), \\
        \sigma_2 &= (1,3,6,4,7,5,2,8),
    \end{aligned}$$ and $\tau=\sigma_1=(1,3,2,4)$. We have $\Phi_{\operatorname{dif}}(\sigma_j)=0$ for $j=0,1,2$, and $\tau(1)=1, \tau(4)=4$. By repeated application of the link algorithm, we obtain the following three families of permutations: $$\begin{aligned}
        &(1,4,2,5,3,6), \\
        &(1,4,2,5,3,6\mid8,7,9), \\
        &(1,4,2,5,3,6\mid8,7,9\mid11,10,12), \\
        &\vdots\\
        &(1,3,2,4) ,\\
        &(1,3,2,4\mid6,5,7) ,\\
        &(1,3,2,4\mid6,5,7\mid9,8,10) ,\\
        &\vdots\\
        &(1,3,6,4,7,5,2,8) ,\\
        &(1,3,6,4,7,5,2,8\mid10,9,11) ,\\
        &(1,3,6,4,7,5,2,8\mid10,9,11\mid13,12,14) ,\\
        &\vdots\end{aligned}$$ of length $$\begin{aligned}
    n&=6,9,12,15,\ldots    \qquad (3k) \\
    n&=4,7,10,13,\ldots    \qquad (3k+1) \\
    n&=8,11,14,17\ldots    \qquad (3k+2)\end{aligned}$$ Hence we have constructed one permutation $\pi\in{\mathfrak{S}}_n$ for each $n>5$ such that $\Phi_{\operatorname{dif}}(\pi)=0$ and $\pi(1)=1$ and $\pi(n)=n$.

The following proposition is another enhanced version of Theorem \[th:main1\](i) for $\Phi_{\operatorname{dif}}$, which is crucial for proving Theorem \[th:main1\](ii) for $\Phi_{\operatorname{cycdif}}$. The difference between Propositions \[th:prop1\] and \[th:prop2\] lies in the value of $\pi(n)$.

\[th:prop2\] For any integer $n>7$, there is a permutation $\pi\in {\mathfrak{S}}_n$ such that $\pi(1)=1, \pi(n)=n-1$ and $\Phi_{\operatorname{dif}}(\pi)=0$.\

Let $$\begin{aligned}
    \alpha_8&= (1,2,4,8,6,5,3,7),\\
    \alpha_9&= (1,4,2,5,9,3,7,6,8),\\
    \alpha_{10}&=(1,2,6,3,7,8,5,4,10,9),\\
    \alpha_{11}&=(1,2,3,4,6,5,9,8,7,11,10),\\
    \alpha_{12}&=(1,2,3,6,4,8,12,10,9,7,5,11).\end{aligned}$$ We have $\alpha_j(1)=1$, $\alpha(j)=j-1$, and $\Phi_{\operatorname{cycdif}}(\alpha_j)=0$ for $j=8,9,\ldots, 12$. The proposition is true for $j=8,9, \ldots, 12$. For $n\geq 13$ and $k=n-7\geq 6$, take the permutation $\sigma\in{\mathfrak{S}}_{k}$ obtained in Proposition \[th:prop1\], i.e., $\sigma(1)=1, \sigma(k)=k, \Phi_{\operatorname{dif}}(\sigma)=0$. Then, the link $\rho=\langle \sigma, \alpha_8\rangle$ satisfies $\rho(1)=1, \rho(n)=n-1$ and $\Phi_{\operatorname{dif}}(\rho)=0$. For example, for $n=13$ and $k=6$, $$\rho=\langle (1,4,2,5,3,6), (1,2,4,8,6,5,3,7)\rangle = (1,4,2,5,3,6,7,9,13,11,10,8,12).$$ Hence, the proposition is true for any $n>7$.

Now we are ready to prove part (ii) of Theorem \[th:main1\] for the rational function $\Phi_{\operatorname{cycdif}}$.

If $n=2k$ is even, we can easily check that the permutation $$\pi=(1,2,3,\ldots, k-1, k, 2k, 2k-1, \ldots, k+3, k+2, k+1),$$ which is obtained by the concatenation of the increasing permutation of ${\mathfrak{S}}_k$ and the decreasing permutation of $\{j \mid k+1\leq j\leq 2k\}$, satisfies $$\Phi_{\operatorname{cycdif}}(\pi)=
        \left(-\frac 11 - \frac 11 - \cdots -\frac 11 -\frac {1}{k}
        +\frac 11 + \frac 11 + \cdots +\frac 11\right) +\frac {1}{k}
=0.$$ The odd case is more complicated. First, we define $$\begin{aligned}
    \beta_9 &= (2,1,4,5,9,3,7,6,8), \\
    \beta_{11} &= (1,2,11,5,4,8,7,9,3,6,10), \\
    \beta_{13} &= (1,2,13,3,5,4,9,8,10,6,11,7,12).\end{aligned}$$ We have $\Phi_{\operatorname{cycdif}}(\beta_j)=0$ for $j=9,11,13$. Next, for $n=2k+1\geq 15$, i.e., $k\geq 7$ and $m=k+1\geq 8$, by Propositions \[th:prop1\] and \[th:prop2\], there exist two permutations $\sigma\in{\mathfrak{S}}_{k}$ and $\sigma\in{\mathfrak{S}}_{m}$ such that

[(i)]{} $\sigma(1)=1$, $\sigma(k)=k$, and $\Phi_{\operatorname{dif}}(\sigma)=0$;

[(ii)]{} $\tau(1)=1$, $\tau(m)=m-1$, and $\Phi_{\operatorname{dif}}(\tau)=0$.

Let $\tau'$ be the permutation of $\{j\mid k+1\leq j \leq 2k+1\}$ obtained by adding $k$ in the reverse of $\tau$: $$\tau'=(k+\tau(m), k+\tau(m-1), k+\ldots, k+\tau(3), k+\tau(2), k+\tau(1) ).$$ Notice that the first and last elements of $\tau'$ are $k+\tau(m)=2k$ and $k+\tau(1)=k+1$, respectively. Let $\rho$ be the concatenation of $\sigma$ and $\tau'$. We can verity that $\Phi_{\operatorname{dif}}(\tau') = -\Phi_{\operatorname{dif}}(\tau)=0$ and $$\Phi_{\operatorname{cycdif}}(\rho) = \Phi_{\operatorname{dif}}(\sigma) + \frac {1}{k-2k} + \Phi_{\operatorname{dif}}(\tau') + \frac {1}{(k+1)-1}=0.$$ For example, for $n=15$, $k=7$ and $m=8$, we have $\sigma=(1,3,2,4,6,5,7)$ and $\tau= (1,2,4,8,6,5,3,7)$, so that $\tau'=(14, 10, 12, 13, 15, 11, 9, 8 )$. Our final permutation $\rho$ is the concatenation of $\sigma$ and $\tau'$: $$\rho=(1,3,2,4,6,5,7, \ 14, 10, 12, 13, 15, 11, 9, 8).$$ We can check that $\Phi_{\operatorname{cycdif}}(\rho)=0$.

To prove part (iii) of Theorem \[th:main1\] concerning the rational function $\Phi_{\operatorname{prod}}$, we need the following lemma. Also, it is much more convenient to describe the construction in the increasing binary trees model [@Stanley2012EC1; @Flajolet2009Sed].

\[th:insertion\] Let $\sigma=\sigma(1)\sigma(2)\cdots\sigma(n-1)\in{\mathfrak{S}}_{n-1}$ be a permutation and $\tau\in{\mathfrak{S}}_n$ be the permutation obtained by insertion of the letter $n$ into $\sigma$: $$\tau=\sigma(1)\cdots \sigma(j)\,n\,\sigma(j+1)\cdots\sigma(n-1). 
    \qquad (j=1,2,\ldots, n-2)$$ Then, $\Phi_{\operatorname{prod}}(\sigma)=\Phi_{\operatorname{prod}}(\tau)$ if and only if $\sigma(j)+\sigma(j+1)=n$.

We have $$\begin{aligned}
    \Phi_{\operatorname{prod}}(\sigma) = \sum_{k=1}^{n-2} 
    \frac {1}{\sigma(k)\sigma(k+1)} 
    &= \cdots + \frac {1}{\sigma(j)\sigma(j+1)} +\cdots \cr
    \Phi_{\operatorname{prod}}(\tau) = \sum_{k=1}^{n-1} 
    \frac {1}{\tau(k)\tau(k+1)} 
    &= \cdots + \frac {1}{\sigma(j)\,n} + \frac {1}{n\,\sigma(j+1)} +\cdots \cr
    &   = \cdots + \frac {\sigma(j)+\sigma(j+1)}{n\, \sigma(j)\sigma(j+1)} +\cdots \end{aligned}$$ Hence, $\Phi_{\operatorname{prod}}(\sigma)=\Phi_{\operatorname{prod}}(\tau)$ if and only if $$\frac {1}{\sigma(j)\sigma(j+1)} 
=    \frac {\sigma(j)+\sigma(j+1)}{n\, \sigma(j)\sigma(j+1)},$$ i.e., $\sigma(j)+\sigma(j+1)=n$.

child[ node \[arnn\] [4]{} child[ node \[arnn\] [6]{} child\[missing\][ ]{} child[ node \[arnn\] [10]{} child[node\[arnb\] [16]{}]{} child[node\[arnn\] [14]{} child[node\[arnb\] [24]{}]{} child[node\[arnn\] [18]{} child[node \[arnb\][32]{}]{} child[node\[arnn\] [22]{} child\[missing\] child[node\[arnn\] [26]{} child\[missing\] child[node\[arnn\] [30]{} ]{} ]{} ]{} ]{} ]{} ]{} ]{} child\[missing\][ ]{} ]{} child[ node \[arnn\] [2]{} child\[missing\][ ]{} child[ node \[arnn\] [3]{} child[ node \[arnn\] [5]{} child[ node \[arnn\] [7]{} child[ node \[arnn\] [9]{} child[ node \[arnn\] [11]{} child[ node \[arnn\] [13]{} child[ node \[arnn\] [15]{} child[ node \[arnn\] [17]{} child[ node \[arnn\] [19]{} child[ node \[arnn\] [21]{} child[ node \[arnn\] [23]{} child[ node \[arnn\] [25]{} child[ node \[arnn\] [27]{} child[ node \[arnn\] [29]{} child[ node \[arnn\] [31]{} ]{} child\[missing\] ]{} child\[missing\] ]{} child\[missing\] ]{} child\[missing\] ]{} child\[missing\] ]{}child\[missing\] ]{}child\[missing\] ]{}child[node \[arnr\][28]{}]{} ]{} child\[missing\] ]{} child[ node \[arnr\] [20]{}]{} ]{} child\[missing\] ]{} child[ node \[arnr\] [12]{}]{} ]{} child\[missing\] ]{} child[ node \[arnn\] [8]{}]{} ]{} ]{} ; at (-3.5,-5.4) [$8k$]{}; at (-0.4,-5.7) [$4k+2$]{}; at (2.6,-7.8) [$8k+4$]{}; at (0.3,-13) [$2k+1$]{};

Now we use the insertion lemma to prove part (iii) of our main theorem.

Let $$\begin{aligned}
\delta_6 &=  (2, 1, 3, 4, 5, 6), \\
    \delta_7&= (2, 1, 3, 7, 4, 5, 6),\\
    \delta_8&=(6,4,1,2,7,5,3,8).\end{aligned}$$ We verify that $\Phi_{\operatorname{prod}}(\delta_j)=1$ for $j=6,7,8$. By insertion lemma, we define $\sigma_9$ by inserting the letter $9$ between $2$ and $7$ in $\sigma_8$: $$\sigma_9=(6,4,1,2,{\bf 9}, 7,5,3,8).$$ Next, we insert $10$ in $\sigma_9$ between $6$ and $4$: $$\sigma_{10}=(6,{\bf 10}, 4,1,2, 9, 7,5,3,8).$$ For the insertion of $11$, we have two possible positions, namely, between $(2, 9)$ and $(3, 8)$. We choose the position $(2,9)$ and define $$\sigma_{11}=(6, 10, 4,1,2,{\bf 11}, 9, 7,5,3,8).$$ The crucial idea is to show that this kind of insertion can be repeatedly applied as many times as we want, starting from $\sigma_8$. Thus, we obtain the desired permutation $\sigma_n\in{\mathfrak{S}}_n$ for each $n\geq 8$. To understand the general pattern, we take a rather big example with $n=32$. Our permutation $\delta_{32}$ is as follows: $$\begin{gathered}
        \delta_{32}=(6, 16, 10, 24, 14, 32, 18, 22, 26, 30, 4, 1, 2, \\
31, 29, 27, 25, 23, 21, 19, 17, 15, 28, 13, 11, 20, 9, 7, 12, 5, 3, 8),
    \end{gathered}$$ which can be represented by the increasing binary tree [@Stanley2012EC1; @Flajolet2009Sed] in Figure \[fig:1\]. We see that the nodes of the form $2k+1, 4k+2, 8k, 8k+4$ all appear in the tree structure. Hence, the insertion can be repeatedly applied to reach each $\delta_{n}$ for $n\geq 8$.

As proved in Theorem \[th:main1\], for any integer $n>5$, there is a permutation $\pi\in {\mathfrak{S}}_n$ such that $\Phi_{\operatorname{dif}} (\pi) =0$. For a permutation $\pi$, the value of $\Phi_{\operatorname{dif}}(\pi)$ is, a priori, a rational number. Theorem \[th:main2\] provides a full characterization of the integer values of the rational function $\Phi_{\operatorname{dif}}$.

In fact, we need to prove a stronger statement by replacing each $V_n$ in the theorem by $$V_n'=\left\{\sum_{k=1}^{n-1} \frac{1}{\pi(k)-\pi(k+1)}  : 
    \pi\in{\mathfrak{S}}_n, \pi(n)=n\right\}.$$

It is easy to see that $n-1\in V_n'$ by taking the identity permutation $(1,2,\ldots n)$. Also, the maximal value of $\Phi_{\operatorname{dif}}(\pi)$ is $n-1$, so that $m\not\in V_n$ for $m\geq n$. We can check by computer for all $n\leq 6$. If $n\geq 7$, we prove by induction on $n$. First, $0\in V_n'$ by Proposition \[th:prop1\]. Next, for $1\leq m \leq n-3$, by the induction hypothesis, there is a permutation $\tau\in{\mathfrak{S}}_{n-1}$ such that $\tau(n-1)=n-1$ and $\Phi_{\operatorname{dif}}(\tau)=m-1$. We define $$\pi=(\tau(1), \tau(2), \ldots, \tau(n-1), n).$$ We verify that $\Phi_{\operatorname{dif}}(\pi)= 1 + \Phi_{\operatorname{dif}}(\tau)=m$. Finally, for each $\sigma\in{\mathfrak{S}}_n$ which is not the identity permutation, we see that there exists at least one negative term in the summation . Hence $\Phi_{\operatorname{dif}}(\sigma)<n-2$, and $n-2\not\in V_n$.

[1]{}

Philippe Flajolet and Robert Sedgewick. . Cambridge University Press, Cambridge, 2009.

Robert Sedgewick. Permutation generation methods. , 9(2):137–164, 1977.

R. P. Stanley. , volume 49 of [ *Cambridge Studies in Advanced Mathematics*]{}. Cambridge University Press, Cambridge, second edition, 2012.

Zhi-Wei Sun. n permutation of $\{1,\ldots,n\}$ and related topics. , 1811.10503, 2018.