TOPICS
Search

Hofstadter H-Sequence


The Hofstadter H-sequence is defined by H(0)=0 and

 H(n)=n-H(H(H(n-1)))

for integers n>=1. The first few terms for n=1, 2, ... are 1, 1, 2, 3, 4, 4, 5, 5, 6, 7, 7, 8, 9, 10, 10, 11, 12, 13, 13, 14, ... (OEIS A005374).

The generalized Hofstadter sequences include the Hofstadter G-sequence G=F_2 and H=F_3. Letouzey (2026) proved G(n)<=H(n) for every n>=0, with strict inequality for n>12.


Explore with Wolfram|Alpha

References

Hofstadter, D. R. Gödel, Escher, Bach: An Eternal Golden Braid. New York: Vintage Books, p. 137, 1989.Letouzey, P. "Re-Ordering the Generalized Hofstadter Functions G, H, and Beyond." 26 Oct 2026. https://arxiv.org/abs/2610.35994.Sloane, N. J. A. Sequence A005374/M0449 in "The On-Line Encyclopedia of Integer Sequences."

Referenced on Wolfram|Alpha

Hofstadter H-Sequence

Cite this as:

Weisstein, Eric W. "Hofstadter H-Sequence." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/HofstadterH-Sequence.html

Subject classifications