Hofstadter Sequence Calculator

Self-referential recurrences

CalculatorsFreeNo Signup
4.3(464 reviews)
All Tools

Loading tool...

About Hofstadter Sequence Calculator

A Hofstadter sequence calculator computing Q(n), R(n), and other chaotic self-referential recurrences from Gödel, Escher, Bach. Shows terms, growth analysis, and the beautiful quasi-random behavior. Client-side.

Hofstadter Sequence Calculator Features

  • Q-sequence
  • R-sequence
  • Growth plot
  • Chaotic behavior
  • GEB
Hofstadter Q-sequence: Q(1)=Q(2)=1, Q(n)=Q(n−Q(n−1)). From Gödel, Escher, Bach. Behaves chaotically yet Q(n)/n→1. The R-sequence uses a different self-reference. These meta-Fibonacci sequences are notoriously difficult to analyze.

How to Use

Enter n:

  • Q(n): Hofstadter Q value
  • Sequence: First n terms
  • Ratio: Q(n)/n convergence

Chaotic Behavior

Q(n) is extremely erratic: no known closed form, no proven growth rate, no proof it's even defined for all n (conjectured). Q(n)/n appears to converge to 1 but this is unproven. Consecutive differences are unbounded.

Hofstadter Variants

  • Q: Q(n) = Q(n−Q(n−1))
  • R: R(n) = R(n−R(n−1)) + R(n−R(n−2))
  • Male/Female: mutual recursion
  • Figure-Ground: based on complement

Step-by-Step Instructions

  1. 1Choose sequence type.
  2. 2Enter n.
  3. 3View terms.
  4. 4Analyze ratio.
  5. 5Compare variants.

Hofstadter Sequence Calculator — Frequently Asked Questions

Is Q(n) defined for all n?+

Conjectured yes, but unproven! If Q(k)>k for some k, the recursion would reference Q at a negative index. Empirically Q(n)<n for all computed values (billions of terms), but no proof exists. This is one of the simplest open problems in mathematics.

Why does Hofstadter call it 'chaotic'?+

Q(n) has no discernible pattern: Q(1..20) = 1,1,2,3,3,4,5,5,6,6,6,8,8,8,10,9,10,11,11,12. The differences Q(n)−Q(n−1) alternate irregularly between positive, negative, and zero. Yet the ratio Q(n)/n stays near 1.

What's the connection to GEB?+

Douglas Hofstadter introduced Q(n) in Gödel, Escher, Bach (1979) as an example of self-reference and strange loops — systems that refer to themselves. The sequence embodies the book's theme: simple rules creating complex, unpredictable behavior.

Share this tool: