Math 2.0

Number theory Example

Hofstadter sequences

Example

Hofstadter sequences are integer sequences defined by nested nonlinear recurrences, in which earlier values decide which earlier terms are used.

  1. The Hofstadter QQ-sequence is given by Q(1)=Q(2)=1Q(1) = Q(2) = 1 and Q(n)=Q(n−Q(n−1))+Q(n−Q(n−2))Q(n) = Q(n - Q(n-1)) + Q(n - Q(n-2)) for n>2n > 2. It begins 1,1,2,3,3,4,5,5,6,6,6,8,…1, 1, 2, 3, 3, 4, 5, 5, 6, 6, 6, 8, \dots.
  2. The Hofstadter GG-sequence is given by G(0)=0G(0) = 0 and G(n)=n−G(G(n−1))G(n) = n - G(G(n-1)) for n≥1n \ge 1. It begins 0,1,1,2,3,3,4,4,5,…0, 1, 1, 2, 3, 3, 4, 4, 5, \dots.

Check for QQ: Q(3)=Q(2)+Q(2)=2Q(3) = Q(2) + Q(2) = 2, Q(4)=Q(2)+Q(3)=3Q(4) = Q(2) + Q(3) = 3, Q(5)=Q(2)+Q(3)=3Q(5) = Q(2) + Q(3) = 3, Q(6)=Q(3)+Q(3)=4Q(6) = Q(3) + Q(3) = 4. Check for GG: G(1)=1−G(0)=1G(1) = 1 - G(0) = 1, G(2)=2−G(1)=1G(2) = 2 - G(1) = 1, G(3)=3−G(1)=2G(3) = 3 - G(1) = 2, G(4)=4−G(2)=3G(4) = 4 - G(2) = 3. The GG-sequence has the closed form G(n)=⌊(n+1)/φ⌋G(n) = \lfloor (n+1)/\varphi \rfloor, where φ\varphi is the golden ratio. The QQ-sequence behaves erratically, and it is not known whether it is defined for all nn, that is, whether n−Q(n−1)≥1n - Q(n-1) \ge 1 and n−Q(n−2)≥1n - Q(n-2) \ge 1 always hold.

Further reading

  1. Web https://en.wikipedia.org/wiki/Hofstadter_sequence
About this page
TagZNT0P1M1D5
URIm2://ZNT0P1M1D5
Kindexample
WritingW0 stub
MSC11B37, 39A05
IllustratesNonlinear difference equation
Same as

Markdown · JSON · Edit on GitHub

What this page needs for W1

  • an inventory row: the row of the inventory that the node accounts for (0 of 1)
  • a source with a locator (0 of 1)

The writing levels say how complete the text of a page is. They do not measure its truth.

What links here

No page links to this page yet.