Return of the superheroes

Problem

For an odd prime pp and 1≤a,b≤n<p1\le a,b\le n<p,

x0=0,Ta,b(x)=x2+ax+b(modp),xj+1=Ta,b(xj),fp(a,b)=min⁡{j≥1:xj∈{x0,…,xj−1}}.\begin{aligned} x_0&=0,\\ T_{a,b}(x)&=x^2+ax+b\pmod p,\\ x_{j+1}&=T_{a,b}(x_j),\\ f_p(a,b)&=\min\{j\ge1:x_j\in\{x_0,\ldots,x_{j-1}\}\}. \end{aligned} B(n,p)=max⁡π∈Snmin⁡1≤a≤nfp(a,π(a))\boxed{B(n,p)=\max_{\pi\in S_n}\min_{1\le a\le n}f_p(a,\pi(a))}

IBM, July 2026: determine

B(611,14411),max⁡2≤n≤999B(n,17377).B(611,14411),\qquad \max_{2\le n\le999}B(n,17377).

Orbits

Tail length μ\mu, cycle length λ\lambda:

x0→⋯→xμ−1→xμ→⋯→xμ+λ−1→xμ⏟λ-cycle,fp(a,b)=μ+λ.\begin{gathered} x_0\to\cdots\to x_{\mu-1}\to \underbrace{x_\mu\to\cdots\to x_{\mu+\lambda-1}\to x_\mu}_{\lambda\text{-cycle}},\\ f_p(a,b)=\mu+\lambda. \end{gathered}

For (a,b,p)=(1,3,101)(a,b,p)=(1,3,101),

0,3,15,41,8,75,47,37,96,23,50,28,7,59⏟λ=10,8‾,…μ=4,λ=10,f101(1,3)=14.\begin{gathered} 0,3,15,41,\underbrace{8,75,47,37,96,23,50,28,7,59}_{\lambda=10},\underline{8},\ldots\\ \mu=4,\qquad \lambda=10,\qquad f_{101}(1,3)=14. \end{gathered}

Conjugacy

In Fp\mathbb F_p, put s=a/2s=a/2, c=b+s−s2c=b+s-s^2, and τs(x)=x+s\tau_s(x)=x+s. Then

τs∘Ta,b∘τs−1(y)=y2+c=:qc(y),y0=s,fp(a,b)=μc(s)+λc(s).\begin{aligned} \tau_s\circ T_{a,b}\circ\tau_s^{-1}(y)&=y^2+c=:q_c(y),\\ y_0&=s,\\ f_p(a,b)&=\mu_c(s)+\lambda_c(s). \end{aligned}

Memoize (μc(y),λc(y))(\mu_c(y),\lambda_c(y)) per discovered state (c,y)(c,y):

y on an ℓ-cycle:(μc(y),λc(y))=(0,ℓ),y off-cycle:μc(y)=1+μc(qc(y)),λc(y)=λc(qc(y)).\begin{aligned} y\text{ on an }\ell\text{-cycle}:&\quad(\mu_c(y),\lambda_c(y))=(0,\ell),\\ y\text{ off-cycle}:&\quad\mu_c(y)=1+\mu_c(q_c(y)),\\ &\quad\lambda_c(y)=\lambda_c(q_c(y)). \end{aligned}

Matching

Gt=([n],[n],Et),Et={(a,b):fp(a,b)≥t},B(n,p)≥t  ⟺  ν(Gt)=n,Et+1⊆Et.\begin{aligned} G_t&=([n],[n],E_t),\\ E_t&=\{(a,b):f_p(a,b)\ge t\},\\ B(n,p)\ge t&\iff \nu(G_t)=n,\\ E_{t+1}&\subseteq E_t. \end{aligned}

Here ν\nu is the maximum matching size. Binary search in tt; Hopcroft–Karp per threshold:

O((∣Et∣+n)n).O((|E_t|+n)\sqrt n).

For (n,p)=(5,101)(n,p)=(5,101),

π=(3,1,4,2,5),(f101(a,π(a)))a=15=(14,18,19,22,14),ν(G14)=5,ν(G15)=4,B(5,101)=14.\begin{aligned} \pi&=(3,1,4,2,5),\\ \bigl(f_{101}(a,\pi(a))\bigr)_{a=1}^5&=(14,18,19,22,14),\\ \nu(G_{14})&=5,\qquad \nu(G_{15})=4,\\ B(5,101)&=14. \end{aligned}

Certificates

Hall’s theorem, with Nt(S)N_t(S) the neighbors of SS in GtG_t:

ν(Gt)=n  ⟺  ∀S⊆[n],∣Nt(S)∣≥∣S∣.\nu(G_t)=n\iff\forall S\subseteq[n],\quad |N_t(S)|\ge|S|.

Thus

π∈Sn,min⁡afp(a,π(a))≥t⟹B(n,p)≥t,∣Nt+1(S)∣<∣S∣⟹B(n,p)≤t.\begin{gathered} \pi\in S_n,\quad \min_a f_p(a,\pi(a))\ge t\\ \Longrightarrow B(n,p)\ge t,\\[6pt] |N_{t+1}(S)|<|S|\Longrightarrow B(n,p)\le t. \end{gathered}

A singleton obstruction on either side gives

B(n,p)≤min⁡amax⁡bfp(a,b),B(n,p)≤min⁡bmax⁡afp(a,b).\begin{aligned} B(n,p)&\le\min_a\max_b f_p(a,b),\\ B(n,p)&\le\min_b\max_a f_p(a,b). \end{aligned}

Required instance

For p=14411p=14411, exact computation gives

max⁡1≤a≤611fp(a,493)=349,arg max⁡1≤a≤611fp(a,493)={402}.\begin{aligned} \max_{1\le a\le611}f_p(a,493)&=349,\\ \operatorname*{arg\,max}_{1\le a\le611}f_p(a,493)&=\{402\}. \end{aligned}

The certificate supplies π∈S611\pi\in S_{611} with

π(402)=493,fp(402,π(402))=349,a≠402⟹fp(a,π(a))≥350.\begin{aligned} \pi(402)&=493,\\ f_p(402,\pi(402))&=349,\\ a\ne402&\Longrightarrow f_p(a,\pi(a))\ge350. \end{aligned} 349≤B(611,14411)≤349\boxed{349\le B(611,14411)\le349}

Bonus

Fix p=17377p=17377. Exact maxima:

max⁡1≤a≤490fp(a,1)=404,max⁡1≤b≤777fp(145,b)=405,max⁡1≤b≤999fp(759,b)=408,max⁡1≤a≤923fp(a,513)=405.\begin{aligned} \max_{1\le a\le490}f_p(a,1)&=404,\\ \max_{1\le b\le777}f_p(145,b)&=405,\\ \max_{1\le b\le999}f_p(759,b)&=408,\\ \max_{1\le a\le923}f_p(a,513)&=405. \end{aligned}

Hence

B(n,p)≤{404,2≤n≤490,405,491≤n≤777,408,778≤n≤999,B(n,p)\le \begin{cases} 404,&2\le n\le490,\\ 405,&491\le n\le777,\\ 408,&778\le n\le999, \end{cases}

and

778≤n≤923⟹B(n,p)≤405<408.778\le n\le923\Longrightarrow B(n,p)\le405<408.

The certificate supplies a base matching π924\pi_{924} and augmenting-path updates:

π924⇝π925⇝⋯⇝π999,∀n∈{924,…,999},πn∈Sn,min⁡a≤nfp(a,πn(a))≥408.\begin{gathered} \pi_{924}\rightsquigarrow\pi_{925}\rightsquigarrow\cdots\rightsquigarrow\pi_{999},\\ \forall n\in\{924,\ldots,999\},\quad\pi_n\in S_n,\\ \min_{a\le n}f_p(a,\pi_n(a))\ge408. \end{gathered} max⁡2≤n≤999B(n,17377)=408\boxed{\max_{2\le n\le999}B(n,17377)=408} arg max⁡2≤n≤999B(n,17377)={924,…,999}\boxed{\operatorname*{arg\,max}_{2\le n\le999}B(n,17377)=\{924,\ldots,999\}}