1 Introduction

The sequence of Euler up/down numbers \((E_n)_{n\ge 0}\) is the sequence with exponential generating series

$$\begin{aligned} \sum _{n=0}^{\infty } \frac{E_n}{n!} x^n = \sec x + \tan x. \end{aligned}$$
(1)

It is referenced as sequence A000111 in the On-Line Encyclopedia of Integer Sequences (Sloane 2017) and its first terms are

$$\begin{aligned} 1, 1, 1, 2, 5, 16, 61, 272, 1385, 7936, 50521, 353792, 2702765,\ldots \end{aligned}$$

The numbers \(E_n\) were shown by André (1879) to count up/down permutations on n elements (see Sect. 3).

Knuth and Buckholtz (1967) proved that for any integer \(q\ge 1\), the sequence \((E_n \mod q)_{n\ge 0}\) is ultimately periodic. For any \(q \ge 1\) we define:

  • s(q) to be the minimum number of terms one needs to delete from the sequence \((E_n \mod q)_{n \ge 0}\) to make it periodic;

  • d(q) to be the smallest period of the sequence \((E_n \mod q)_{n \ge s(q)}\).

For example, the sequence \((E_n \mod 3)\) starts with

$$\begin{aligned} 1,1,1,2,2,1,1,2,2,1,1,2,2,\ldots \end{aligned}$$

so one might expect to have \(s(3)=1\) and \(d(3)=4\). Clearly \(s(1)=0\) and \(d(1)=1\). In the remainder of this paper, we formulate precise conjectures for the values of s(q) and d(q) for any \(q\ge 2\).

Organisation of the paper In Sect. 2 we reduce the problem to the case when q is a prime power and we conjecture the values of s(q) and d(q) when q is an odd prime power. In Sect. 3 we conjecture the values of s(q) and d(q) when q is a power of 2, after having introduced the Entringer numbers and a sequence defined by Arnold describing the 2-adic valuation of the Entringer numbers. In Sect. 4, we provide a simple construction which conjecturally yields the Arnold sequence.

2 Case When q is Not a Power of 2

The following lemma implies that it suffices to know the values of s(q) and d(q) when q is a prime power in order to know the values of s(q) and d(q) for any \(q \ge 2\).

Lemma 1

Fix \(q \ge 2\) and write its prime number decomposition as

$$\begin{aligned} q=\prod _{i=1}^k p_i^{\alpha _i}, \end{aligned}$$
(2)

where \(k\ge 1,\) \(p_1,\ldots ,p_k\) are distinct prime numbers and \(\alpha _1,\ldots ,\alpha _k\) are positive integers. Then

$$\begin{aligned} s(q)= & {} \max _{1 \le i \le k} s(p_i^{\alpha _i}) \end{aligned}$$
(3)
$$\begin{aligned} d(q)= & {} {{\mathrm{lcm}}}(d(p_1^{\alpha _1}),\ldots ,d(p_k^{\alpha _k})). \end{aligned}$$
(4)

The proof is elementary and uses the Chinese remainder theorem.

When q is an odd prime power, Knuth and Buckholtz (1967) found the following:

Theorem 2

(Knuth and Buckholtz 1967) Let p be an odd prime number.

  1. (1)

    If \(p \equiv 1 \mod 4,\) then

    $$\begin{aligned} d(p)=p-1. \end{aligned}$$
  2. (2)

    If \(p \equiv 3 \mod 4,\) then

    $$\begin{aligned} d(p)=2p-2. \end{aligned}$$
  3. (3)

    For any \(k\ge 1,\)

    $$\begin{aligned} s(p^k)\le k. \end{aligned}$$
  4. (4)

    For any \(k\ge 2,\)

    $$\begin{aligned} d(p^k) | p^{k-1} d(p). \end{aligned}$$

We conjecture the following for the exact values of s(q) and d(q) when q is an odd prime power:

Conjecture 1

Let p be an odd prime number.

  1. (1)

    For any \(k\ge 1,\)

    $$\begin{aligned} s(p^k)=k. \end{aligned}$$
  2. (2)

    For any \(k\ge 2,\)

    $$\begin{aligned} d(p^k)=p^{k-1} d(p). \end{aligned}$$

Conjecture 1 is supported by Mathematica simulations done for all odd prime powers \(q<1000\).

3 Entringer Numbers and Case When q is a Power of 2

Formulating a conjecture analogous to Conjecture 1 for powers of 2 requires to define, following Arnold (1991), a sequence describing the behavior of the 2-adic valuation of the Entringer numbers.

3.1 The Seidel–Entringer–Arnold Triangle

The Entringer numbers are a refined version of the Euler numbers, enumerating some subsets of up/down permutations. For any \(n\ge 0\), a permutation \(\sigma \in \mathcal S_n\) is called up/down if for any \(2\le i \le n\), we have \(\sigma (i-1)<\sigma (i)\) (resp. \(\sigma (i-1)>\sigma (i)\)) if i is even (resp. i is odd). André (1879) showed that the number of up/down permutations on n elements is \(E_n\). For any \(1 \le i \le n\), the Entringer number \(e_{n,i}\) is defined to be the number of up/down permutations \(\sigma \in \mathcal S_n\) such that \(\sigma (n)=i\). The Entringer numbers are usually displayed in a triangular array called the Seidel–Entringer–Arnold triangle, where the numbers \((e_{n,i})_{1 \le i\le n}\) appear from left to right on the n-th line (see Fig. 1).

Fig. 1
figure 1

First five lines of the Seidel–Entringer–Arnold triangle

The Entringer numbers can be computed using the following recurrence formula (see for example Stanley 2012). For any \(n\ge 2\) and for any \(1\le i \le n\), we have

$$\begin{aligned} e_{n,i}= {\left\{ \begin{array}{ll} \sum _{j<i} e_{n-1,j} &{}\text {if n is even} \\ \sum _{j\ge i} e_{n-1,j} &{}\text {if n is odd}. \end{array}\right. } \end{aligned}$$
(5)

3.2 Arnold’s Sequence

Replacing each entry of the Seidel–Entringer–Arnold triangle by its 2-adic valuation, we obtain an infinite triangle denoted by T (see Fig. 2).

Fig. 2
figure 2

First five lines of the triangle T of 2-adic valuations of the Entringer numbers

We read this triangle T diagonal by diagonal, with diagonals parallel to the left boundary. For any \(i\ge 1\), denote by \(D_i\) the i-th diagonal of the triangle T parallel to the left boundary. For example \(D_1\) starts with \(0,\infty ,0,\infty ,0,\ldots \) For any \(i\ge 1\), denote by \(m_i\) the minimum entry of diagonal \(D_i\). Arnold (1991) observed that the further away one moves from the left boundary, the higher the 2-adic valuation of the Entringer numbers becomes. In particular, he observed (without proof) that the sequence \((m_i)_{i\ge 1}\) was weakly increasing to infinity. He defined the following sequence: for any \(k \ge 1\),

$$\begin{aligned} u_k:=\max \left\{ i\ge 1 | m_i < k \right\} . \end{aligned}$$

In other words, \(u_k\) is the number of diagonals containing at least one entry that is not zero modulo \(2^k\). The sequence \((u_k)_{k\ge 1}\) is referenced as the sequence A108039 in the On-Line Encyclopedia of Integer Sequences (Sloane 2017) and its first few terms are given in Table 1.

Table 1 The first few values of \(u_k\)

Note that the first few terms given by Arnold were incorrect, because the entry 4 appeared four times, whereas it should be appearing only three times. We also remark that we cannot define any sequence analogous to \((u_k)\) when studying the p-adic valuations of the Entringer numbers for odd primes p. Indeed, the p-adic valuation 0 seems to appear in diagonals of arbitrarily high index.

3.3 Case When q is a Power of 2

Using the sequence \((u_k)_{k\ge 1}\), we formulate the following conjecture for s(q) and d(q) when q is a power of 2:

Conjecture 2

For any \(k\ge 1,\) we have

$$\begin{aligned} s(2^k)=u_k. \end{aligned}$$
(6)

Furthermore,  if \(k\ge 1\) and \(k\ne 2,\) we have

$$\begin{aligned} d(2^k)= 2^k. \end{aligned}$$
(7)

Finally,  we have \(d(4)=2\).

Numerical simulations performed on Mathematica for \(k\le 12\) support Conjecture 2.

4 Construction of Arnold’s Sequence

In this section we provide a construction which conjecturally yields Arnold’s sequence \((u_k)_{k\ge 1}\).

We denote by \(\mathbb Z_+\) the set of nonnegative integers and we denote by

$$\begin{aligned} S:=\bigsqcup _{d\ge 1}\mathbb Z_+^d \end{aligned}$$

the set of all finite sequences of nonnegative integers. We define a map \(f:S\rightarrow S\), which maps each \(\mathbb Z_+^d\) to \(\mathbb Z_+^{2d}\), as follows. Fix \(\underline{x}=(x_1,\ldots ,x_d)\in S\). If all the \(x_i\)’s are equal to \(x_d\), we set

$$\begin{aligned} f(\underline{x})=(x_d,\ldots ,x_d,2x_d,\ldots ,2x_d), \end{aligned}$$

where \(x_d\) and \(2x_d\) both appear d times on the right-hand side. Otherwise, define

$$\begin{aligned} s:=\max \left\{ 1 \le i \le d-1 | x_i \ne x_d \right\} \end{aligned}$$

and set

$$\begin{aligned} f(\underline{x})=(x_1,\ldots ,x_d,x_1+x_d,\ldots ,x_{s-1}+x_d,2x_d,\ldots ,2x_d), \end{aligned}$$

where \(2x_d\) appears \(d-s+1\) times on the right-hand side. For example, we have

$$\begin{aligned} f((2,4,4,4))=(2,4,4,4,8,8,8,8) \end{aligned}$$
(8)

and

$$\begin{aligned} f((2,4,4,4,8,8,8,8))=(2,4,4,4,8,8,8,8,10,12,12,16,16,16,16,16). \end{aligned}$$
(9)

By iterating this function f indefinitely, one produces an infinite sequence:

Lemma 3

Fix \(d\ge 1\) and \(\underline{x}\in \mathbb Z_+^d\). There exists a unique (infinite) sequence \((X_k)_{k\ge 1}\) such that for any \(k\ge 1\) and for any \(n\ge \log _2 (k/d),\) \(X_k\) is the k-th term of the finite sequence \(f^n(\underline{x})\).

This infinite sequence is called the f-transform of \(\underline{x}\). The lemma follows from the observation that for any \(\ell \ge 1\) and for any \(\underline{y}\in \mathbb Z_+^\ell \), \(\underline{y}\) and \(f(\underline{y})\) have the same first \(\ell \) terms.

We can now formulate a conjecture about the construction of the sequence \((u_k)_{k\ge 1}\):

Conjecture 3

Arnold’s sequence \((u_k)_{k\ge 1}\) is the f-transform of the quadruple (2, 4, 4, 4).

Conjecture 3 is supported by the estimation on Mathematica of \(u_k\) for every \(k\le 512\).