homenowprojectswritingresearchabout

On this page

  • The equation
  • The theorem
  • Why it works
  • A continuum above 2
  • The golden limit
  • Where it came from
  • What is not settled
  • Why bother
  1. Home
  2. /Writing
  3. /Fractal Staircases in a Self-Referential Equation

Fractal Staircases in a Self-Referential Equation

November 1, 2026·9 min read
mathematicsemergenceexperimental mathematicsresearch notes
On this page
  • The equation
  • The theorem
  • Why it works
  • A continuum above 2
  • The golden limit
  • Where it came from
  • What is not settled
  • Why bother
November 1, 2026 correction: The first version of this post said the staircase scales form "a ladder rather than a continuum". That was wrong. Every scale from 2 upward also gives an exact staircase, a continuous branch that the ladder attaches to at 2. The ladder theorem itself stands. The new section A continuum above 2 has the proof, and it also explains the scale near 2.618 that I had listed as unexplained.

Can you still find new mathematics by looking? The Mandelbrot set is the famous example: a one-line rule, iterated, hiding a structure nobody had put there. I wanted to try the same thing deliberately. Not by extending a famous object, but by searching blindly through simple rules and keeping only what is both new and lawful.

This post reports what came out. It is a small result, not a Mandelbrot set. But it is exact, it has a short proof, and as far as I can tell it has not been written down before.

The equation

The equation is

f(x)=x−f(x−f(f(x))),x>0.f(x) = x - f\big(x - f(f(x))\big), \qquad x > 0.f(x)=x−f(x−f(f(x))),x>0.

It has an obvious solution. Try f(x)=c xf(x) = c\,xf(x)=cx: substituting gives c=1−c+c3c = 1 - c + c^3c=1−c+c3, whose roots are the degenerate c=1c = 1c=1 and c=1/φc = 1/\varphic=1/φ, where φ=(1+5)/2\varphi = (1+\sqrt5)/2φ=(1+5​)/2 is the golden ratio. So the straight line f(x)=x/φf(x) = x/\varphif(x)=x/φ solves it.

The surprise is that it has many other solutions, and they are not smooth. They are staircases: continuous functions whose slope is only ever 0 or 1, which repeat exactly when you zoom out by a fixed factor LLL.

Two staircase solutions next to the straight golden solution

The blue staircase repeats when you double xxx. The red one repeats when you multiply xxx by the plastic number ρ≈1.3247\rho \approx 1.3247ρ≈1.3247, the real root of ρ3=ρ+1\rho^3 = \rho + 1ρ3=ρ+1. Neither number appears anywhere in the equation.

The theorem

These two are the first members of an infinite family.

Theorem. Let p≥1p \ge 1p≥1 be an integer and let L=Lp>1L = L_p > 1L=Lp​>1 be the root of

L−p+L1−2p=1.L^{-p} + L^{1-2p} = 1.L−p+L1−2p=1.

Put b=L1−p+L1−2pb = L^{1-p} + L^{1-2p}b=L1−p+L1−2p, so that 1<b<L1 < b < L1<b<L. For every integer kkk, define

f(x)={x−Lk+1−2p,Lk≤x<Lkb(rising step),Lk+1−p,Lkb≤x<Lk+1(flat step).f(x) = \begin{cases} x - L^{k+1-2p}, & L^k \le x < L^k b \quad \text{(rising step)},\\[4pt] L^{k+1-p}, & L^k b \le x < L^{k+1} \quad \text{(flat step)}. \end{cases}f(x)={x−Lk+1−2p,Lk+1−p,​Lk≤x<Lkb(rising step),Lkb≤x<Lk+1(flat step).​

Then fff is continuous, satisfies f(Lx)=L f(x)f(Lx) = L\,f(x)f(Lx)=Lf(x), and solves f(x)=x−f(x−f(f(x)))f(x) = x - f(x - f(f(x)))f(x)=x−f(x−f(f(x))) for every x>0x > 0x>0.

The ladder scales are discrete:

pppScale LpL_pLp​Defined by
1222L=2L = 2L=2
21.32472…1.32472\ldots1.32472…L3=L+1L^3 = L + 1L3=L+1, the plastic number
31.19386…1.19386\ldots1.19386…L5=L2+1L^5 = L^2 + 1L5=L2+1
41.13818…1.13818\ldots1.13818…L7=L3+1L^7 = L^3 + 1L7=L3+1
ppp→1\to 1→1L2p−1=Lp−1+1L^{2p-1} = L^{p-1} + 1L2p−1=Lp−1+1

The ladder of allowed scales

Why it works

The proof is short enough to give in full. The single fact it uses is the defining relation L−p+L1−2p=1L^{-p} + L^{1-2p} = 1L−p+L1−2p=1. Write RkR_kRk​ for the rising step [Lk,Lkb)[L^k, L^k b)[Lk,Lkb) and FkF_kFk​ for the flat step [Lkb,Lk+1)[L^k b, L^{k+1})[Lkb,Lk+1).

First, fff maps each rising step RkR_kRk​ onto the whole period [Lk−p,Lk+1−p)[L^{k-p}, L^{k+1-p})[Lk−p,Lk+1−p). Its left end goes to Lk−Lk+1−2p=Lk−pL^k - L^{k+1-2p} = L^{k-p}Lk−Lk+1−2p=Lk−p by the defining relation, and its right end to Lk+1−pL^{k+1-p}Lk+1−p. That also shows fff is continuous. There are three cases.

xxx on a flat step FkF_kFk​. Then f(x)=Lk+1−pf(x) = L^{k+1-p}f(x)=Lk+1−p and f(f(x))=Lk+1−2pf(f(x)) = L^{k+1-2p}f(f(x))=Lk+1−2p. Put u=x−Lk+1−2pu = x - L^{k+1-2p}u=x−Lk+1−2p. As xxx runs over FkF_kFk​, uuu runs exactly over the rising step Rk+1−pR_{k+1-p}Rk+1−p​. The left end checks out directly, and the right end uses 1−L−2p=(1−L−p)(1+L−p)1 - L^{-2p} = (1 - L^{-p})(1 + L^{-p})1−L−2p=(1−L−p)(1+L−p). On that step f(u)=u−Lk+2−3pf(u) = u - L^{k+2-3p}f(u)=u−Lk+2−3p, so

x−f(u)=Lk+1−2p+Lk+2−3p=Lk+1−p(L−p+L1−2p)=Lk+1−p=f(x).x - f(u) = L^{k+1-2p} + L^{k+2-3p} = L^{k+1-p}\left(L^{-p} + L^{1-2p}\right) = L^{k+1-p} = f(x).x−f(u)=Lk+1−2p+Lk+2−3p=Lk+1−p(L−p+L1−2p)=Lk+1−p=f(x).

xxx on a rising step, and f(x)f(x)f(x) on a rising step. Then u=x−f(f(x))u = x - f(f(x))u=x−f(f(x)) lands exactly on Lk−pbL^{k-p} bLk−pb, the corner where a flat step begins, so f(u)=Lk+1−2pf(u) = L^{k+1-2p}f(u)=Lk+1−2p and x−f(u)=f(x)x - f(u) = f(x)x−f(u)=f(x).

xxx on a rising step, and f(x)f(x)f(x) on a flat step. Then f(f(x))=Lk+1−2pf(f(x)) = L^{k+1-2p}f(f(x))=Lk+1−2p, so u=f(x)u = f(x)u=f(x) itself, and again x−f(u)=f(x)x - f(u) = f(x)x−f(u)=f(x).

That covers every x>0x > 0x>0. The indices k+1−pk+1-pk+1−p and k−pk-pk−p only land on whole steps when ppp is an integer, so this mechanism produces a discrete ladder. It is not the only mechanism, as the next section shows.

A continuum above 2

Take the step height f(Lk)=Lk/2f(L^k) = L^k/2f(Lk)=Lk/2 and any scale L≥2L \ge 2L≥2:

f(x)={x−Lk/2,Lk≤x<Lk 1+L2,Lk+1/2,Lk 1+L2≤x<Lk+1.f(x) = \begin{cases} x - L^k/2, & L^k \le x < L^k\,\tfrac{1+L}{2},\\[4pt] L^{k+1}/2, & L^k\,\tfrac{1+L}{2} \le x < L^{k+1}. \end{cases}f(x)={x−Lk/2,Lk+1/2,​Lk≤x<Lk21+L​,Lk21+L​≤x<Lk+1.​

This also solves the equation exactly. Here the composition never needs to line up across distant periods. On a flat step, f(x)=Lk+1/2f(x) = L^{k+1}/2f(x)=Lk+1/2 stays in the same period precisely because L≥2L \ge 2L≥2. Then f(f(x))=Lk(L−1)/2f(f(x)) = L^k(L-1)/2f(f(x))=Lk(L−1)/2, and u=x−f(f(x))u = x - f(f(x))u=x−f(f(x)) runs over the rising step of the same period, which gives x−f(u)=Lk+1/2=f(x)x - f(u) = L^{k+1}/2 = f(x)x−f(u)=Lk+1/2=f(x). On a rising step there are three subcases, and each closes in one line, as in the proof above.

At L=2L = 2L=2 this branch meets the p=1p = 1p=1 staircase, so the ladder hangs off the end of a continuum. A scan over all two-step staircases with scales up to 4 found nothing else: one continuous branch above 2, and the isolated ladder below it.

The full spectrum of two-step staircase scales

The integer sequences do not use the continuum evenly. The scale near 2.618 that I first could not explain is φ2\varphi^2φ2, on this branch. Sequences that show it match the L=φ2L = \varphi^2L=φ2 staircase to within 10−410^{-4}10−4, about 13 times better than the nearby scale 2.62.62.6. Why the integers pick out φ2\varphi^2φ2 from a continuum of allowed scales is open.

The golden limit

As ppp grows, LpL_pLp​ slides down to 1 and the steps get finer. From 1−L−p=L⋅L−2p1 - L^{-p} = L \cdot L^{-2p}1−L−p=L⋅L−2p one gets L−p→1/φL^{-p} \to 1/\varphiL−p→1/φ. Every staircase stays between L−pL^{-p}L−p and a slightly larger bound, and that band closes onto the straight golden solution.

f(x)/x for several p, closing onto 1/φ

So the integer 2, the plastic number and the golden ratio sit in one family. The straight solution is the p=∞p = \inftyp=∞ end of the ladder.

Where it came from

I did not start from this equation. I enumerated every rule of the form a(n)=Ea(n) = Ea(n)=E, where EEE is built from nnn, the constants 1 and 2, the previous terms a(n−1)a(n-1)a(n−1) and a(n−2)a(n-2)a(n−2), addition, subtraction, and self-reference a(⋅)a(\cdot)a(⋅). That gives about 11.3 million rules, of which about 2,000 produce distinct non-trivial integer sequences. I then kept only sequences that were absent from the OEIS and that showed exact structure their definition does not mention.

The filter's own controls came back correct. It rediscovered Hofstadter's G, Q and Conway sequences, and matched each to its OEIS entry.

One rule kept turning up:

a(n)=n−a(n−a(a(n−1))).a(n) = n - a\big(n - a(a(n-1))\big).a(n)=n−a(n−a(a(n−1))).

Its large-scale shape is the equation above. Depending on the starting values, a(n)/na(n)/na(n)/n settles onto different staircases. Fitting only the phase, the closed form matches sequences up to n=224n = 2^{24}n=224 to within 10−410^{-4}10−4, while the next-best member of the family misses by at least 1.5×10−21.5 \times 10^{-2}1.5×10−2.

Integer sequences against the closed-form staircases, p = 1 to 4

Across 300,000 random seeds, a strict test of the step geometry found p=1p = 1p=1 about 52,000 times, p=2p = 2p=2 about 33,000 times, p=3p = 3p=3 about 5,000 times, and p=4p = 4p=4 only 26 times. Larger ppp did not appear.

One case is proved for every nnn, not just observed. With seed a(1)=2a(1) = 2a(1)=2, a(2)=1a(2) = 1a(2)=1, the sequence is computed by a 13-state automaton reading nnn in binary. An exact decision procedure checks the recurrence for all nnn, and perturbed versions of the rule fail it, as they should.

Several tempting claims did not survive the checks. One was a "continuous family" of solutions that turned out to be the trivial symmetry f(x)→c f(x/c)f(x) \to c\,f(x/c)f(x)→cf(x/c), which every solution has. The theorem was also checked at 80 digits up to p=60p = 60p=60, separately from the proof above.

What is not settled

  • Novelty. I searched for this equation and these scales and did not find them. The nearest work I found, Klaus Pinn's continuous models of meta-Fibonacci sequences, studies different equations. Nested recurrences are a well-studied area, though, and a specialist may recognise this. If you do, please tell me.
  • Convergence. The integer sequences converge to the p≥2p \ge 2p≥2 staircases numerically. That is not proved.
  • Selection. Why a given seed picks a given ppp and phase is unexplained.
  • Completeness. These are not all the solutions. Discontinuous variants also work, and staircases with more than two steps were not classified. Some seeds show a scale near 1.75 that I cannot yet explain.
  • Selection. Integer sequences pick particular scales, such as 2 and φ2\varphi^2φ2, out of the continuum. Why is unexplained.

Why bother

The equation is about as simple as a self-referential rule can be, and nothing in it points to the plastic number, an infinite ladder of scales, or a continuum that begins exactly at 2. They are there anyway, and a proof short enough to read in five minutes holds them in place. That is the kind of hidden structure I set out to look for, and it suggests that blind search, with strict filters for novelty and exactness, can still turn up new mathematics.

The code, data and proof notes are available on request.

Share this post

MS
Marc Sperzel

Builder and independent researcher. MSci Physics, King's College London. Writing about quantum mechanics, gravity, and information theory.

GitHubORCIDEmail

Stay updated

Get notified when I publish new writing or research.

Related posts

The Diósi–Penrose Rate as a Thermal Fluctuation

October 5, 2026

Why Gravity Alone Cannot Decohere a Superposition

October 5, 2026

A Quantum Clock Is Not a Decoherence Law

September 6, 2026