How can I generate the nth number in the Godel, Escher, Bach number sequence?

  • Context: Graduate 
  • Thread starter Thread starter recon
  • Start date Start date
  • Tags Tags
    Sequence
Click For Summary

Discussion Overview

The discussion revolves around generating the nth number in a specific number sequence referenced in Douglas Hofstadter's "Godel, Escher, Bach." Participants explore the properties of the sequence, its differences, and potential algorithms for generating its terms.

Discussion Character

  • Exploratory
  • Mathematical reasoning
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant describes the sequence and notes that every number is represented in the gaps between the terms.
  • Another participant suggests analyzing "first-level" and "second-level" differences to identify patterns in the sequence.
  • Some participants propose that the second-level differences reveal a repeating pattern of 2's and 1's, which may help in establishing a formula.
  • A participant shares an algorithm they developed for generating the sequence, outlining a function that checks for existing numbers and constructs the sequence iteratively.
  • Further contributions discuss the relationship between the first-level differences and the original sequence, suggesting that the second-level differences indicate skipped elements.
  • One participant introduces a more complex approach involving multiple levels of functions and recursive definitions to simplify the algorithmic process.

Areas of Agreement / Disagreement

Participants express various interpretations of the sequence and its properties, with no consensus on a definitive algorithm or method for generating the nth number. Multiple competing views and approaches remain present throughout the discussion.

Contextual Notes

The discussion includes assumptions about the nature of the sequence and its differences, which may not be universally accepted. The proposed algorithms and patterns are based on individual interpretations and may require further validation.

recon
Messages
399
Reaction score
1
I've been reading Godel, Escher and Bach. In Chapter III - Figure and Ground, there is this number sequence:

1 3 7 12 18 26 35 45 56 69 ...

I understand that every number is expressed once, covert or overt, in the sequence above.

For example you can 'find' 2 in the gap between 1 and 3. You can 'find' 4 in the gap between 3 and 7, 5 in the gap between 7 and 12, etc.

Can someone please show me an algorithm that I can use for generating the nth number in this sequence?
 
Mathematics news on Phys.org
Hey, I read that book too. Awesome stuff. I think what Hofstadter was trying to explain there was the different "levels" of sequences--am I correct?

If so, I think you have to take it another level. For example, the "first-level" differences between the numbers are 2, 4, 5, 6, 8, 9, 10, 11, 13,...

But this really doesn't tell you much. But the "second level" differences are 2, 1, 1, 2, 1, 1, 1, 2, ...

Hm. Seems like we may have a pattern. The "second level" differences have a 2, then two 1's, then a 2, then three 1's, then a 2...

I think from this you can set up the pattern. Let me know what you get.
 
I get it now. Thanks philosophking. The problem wasn't primarily about looking at different "levels". It was about looking at the "Figure" and "Ground", i.e. the numbers themselves and the gaps between them on the "first level".
 
philosophking said:
If so, I think you have to take it another level. For example, the "first-level" differences between the numbers are 2, 4, 5, 6, 8, 9, 10, 11, 13,...

But this really doesn't tell you much. But the "second level" differences are 2, 1, 1, 2, 1, 1, 1, 2, ...

Hm. Seems like we may have a pattern. The "second level" differences have a 2, then two 1's, then a 2, then three 1's, then a 2...

I think from this you can set up the pattern. Let me know what you get.
2, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 2,
ok so far
1, 1, 1, 1, 1, 1, 2
hmm...
 
Grapes, are you trying to disprove me or confirm my results? I'm confused :P
 
Your results (2, 1, 1, 2, 1, 1, 1, 2, ) are OK, I just extended them. The first level differences are just the numbers that were "left out" of the first sequence, the second level differences have a 2 whenever the first level differences skips over a element of the original sequence.
 
The algorithm

I think I made the algorithm:

function GEB(){
i := 1;
p := 0;
L.[p] := 1;
while(true){
temp = true;
while(temp) {
if (temp = search(i,L))
i++;
}
L[p+1] := L[p] + i;
p++;
i++;
}
}



function search(x,L){

for (i=1, i<=n, i++){ // n is the number of elements of array L
if (L == x){
return true;
}
}
return false;
}


Is it correct?
 
Take it up another level:

Code:
A = 2, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 2

B = 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1

C = 1 2 3 ...

Now that's even easier, Its just like Pulse Width Modulation, the period of the off pulse increases with n.

Now define a function for each level, and plug each function into the other.

So operating on the integers A (1,2,3..) a function mapping to B and then likewise for A, its easier to program the algo if you break it down like that i think.

The first function would not be recursive like the rest though. i.e. F(n) : C -> B and G(b) : B -> A and G(a) : A -> X

G(x) can be applied recursivley as G(G(G(G(...))) etc...i think.
 
Last edited:

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 3 ·
Replies
3
Views
5K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 15 ·
Replies
15
Views
2K
  • · Replies 6 ·
Replies
6
Views
10K
Replies
1
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 2 ·
Replies
2
Views
8K