8 Replies - 13006 Views - Last Post: 08 June 2012 - 07:50 AM

#1 atraub  Icon User is offline

  • Pythoneer
  • member icon

Reputation: 759
  • View blog
  • Posts: 2,010
  • Joined: 23-December 08

Forget Fibonacci! Other interesting Sequences

Post icon  Posted 06 June 2012 - 10:17 PM

*
POPULAR

Fibonacci numbers get a lot of attention. People treat them as if they're somewhat mystical. I find them interesting, but that's about it. After some reading, I asked myself, why only Fibonacci? What are some other sequences with similarly interesting properties? I came across two sequences that caught my eye:


The first sequence is more fun than interesting.

1, 11, 21, 1211, 111221, 312211, 13112221, 1113213211,

Do you see the pattern? This is a tough one and most people won't see it. Try again, this time, reading the values out loud. One, One-One, Two-One, One-Two One-One, One-One One-Two Two-One, etc...

See it yet?
Spoiler


The second sequence is far more fascinating.

1, 2, 4, 8, 16, 22, 26, 38, 62, 74, 102, 104, 108, 116, 122, 126, 138, 162, 174, 202, 206, 218, 234, 258, 338, 410, 414, 430, 442, 474, 586, 826, 922, 958, 1318, 1342, 1366, ...

This one is a bit more simple, yet it contains some interesting properties. I'm not great at speaking in math terms, but I'll give it a try: this sequence is created by: given a value, x. You multiply all the non-zero digits of x together and then add that value to x. Thus with a value like 62, you multiply 6 x 2 and get 12. 62 + 12 = 74, which is the next value in the sequence.

Who cares, right? It's really not THAT different from the Look/Say, after all, it's just playing with the digits of values, big deal, right? Well, notice this:

3, 6, 12, 14, 18, 26, 38, 62, 74, 102, ...

We started from a different seed, but the two sequences joined at 26. The man whose done a lot of research on this is named Paul Loomis, he theorizes that starting from any positive integer, its sequence will join the sequence started from 1. A C program he wrote proved this to be true for all values less than 1 million. Interestingly, this behavior can be seen for all bases, not just base 10. I actually contacted Paul about this sequence, I was curious what he called it, he told me they're called Digit Product Sequences. Expect a snippet that not only models this sequence, but also has a built-in base changer, coming soon :)

I started looking for other sequences, but found it hard to find any others that had properties that were truly interesting. So, after a nice, long build-up, that leads me to my question. Do you guys know of any other awesome sequences? If so, I'd love to discuss them.

This post has been edited by atraub: 07 June 2012 - 12:18 AM


Is This A Good Question/Topic? 6
  • +

Replies To: Forget Fibonacci! Other interesting Sequences

#2 Sheph  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 432
  • View blog
  • Posts: 1,020
  • Joined: 12-October 11

Re: Forget Fibonacci! Other interesting Sequences

Posted 06 June 2012 - 11:23 PM

I don't find it that fascinating that the series merge, since the number after any given number is only based on the previous number and not anything more. So once one number shows up in two different series, they are bound to merge because what comes before n holds no sway on n+1. However, if the conjecture was that they merge before a certain point (200% of n0 for instance), that might be a lot more fascinating for me. In that one link, he declared 63 a stubborn number. I wonder if that has anything to do with the fact that it is one less than 64. What properties does 64 have that relate to this series?

Definitely interesting! And since the value of a digit is sort of derived meta data for a computer, this can be tricky to program. Good thing you have a base changing manager! :)

This post has been edited by Sheph: 06 June 2012 - 11:24 PM

Was This Post Helpful? 1
  • +
  • -

#3 jon.kiparsky  Icon User is online

  • Pancakes!
  • member icon


Reputation: 7572
  • View blog
  • Posts: 12,717
  • Joined: 19-March 11

Re: Forget Fibonacci! Other interesting Sequences

Posted 06 June 2012 - 11:40 PM

Your look-say sequence fails to be an interesting sequence. There's no reason, by the rules you've given that I can't have


1, 11, 21, 1211, 112111, 21112121, 1231221, ...

Impossible? Not at all. (one 12, one 11), (two 1, one 21, two 1), etc


I can generate as many arbitrary variants of that sort as you like. So your particular sequence is pretty ad-hoc, which makes it as boring as any arbitrary set of numbers to which you've retrofitted a rule. Can you make it an interesting sequence? I don't think so. The only way to make a regular unambiguous grammar for this sequence is to apply an arbitrary rule that we're only going to allow single-digit quantifiers, which means this sequence depends on its representation, which is pretty boring.
Was This Post Helpful? 0
  • +
  • -

#4 atraub  Icon User is offline

  • Pythoneer
  • member icon

Reputation: 759
  • View blog
  • Posts: 2,010
  • Joined: 23-December 08

Re: Forget Fibonacci! Other interesting Sequences

Posted 07 June 2012 - 12:02 AM

The look say sequence was included as more of a fun sequence rather than an overly interesting one (notice I went out of my way to say that in the original post). jon.kiparsky, I think there was some confusion caused by my poor mathematical grammar. The wikipedia article I linked says it better, "read off the digits of the previous member". Digits are always single values, so it would never be read as "one-twelve". This set is more of a fun pattern than anything profoundly interesting. I enjoyed it because it's a sequence that lends itself well to programming. I don't know of any math formula that can be used to generate it, but I can easily write a program to model it. I guess I like it because it's so different, so strange.

I do find it interesting that all the digit product sequences do converge at some point or another. Once you have a single overlap, the two sequences will infinitely follow the same pattern, but the fact that all of these sequences will eventually hit such a number is very interesting to me. What property of the sequence causes that? How could one write a proof to explain this behavior? Why are there no seeds that will cause two sequences to never overlap? It doesn't seem unreasonable to think that there could be two starting points that cause the sequence to run beside each other infinitely, and yet, it seems that there might not be one. Something about it really does spark my interest.

I was really hoping that others might contribute some sequences that they've come across that they find the least bit interesting. I feel like all I ever hear about is how mystical Fibonacci's are.

This post has been edited by atraub: 07 June 2012 - 12:17 AM

Was This Post Helpful? 0
  • +
  • -

#5 jon.kiparsky  Icon User is online

  • Pancakes!
  • member icon


Reputation: 7572
  • View blog
  • Posts: 12,717
  • Joined: 19-March 11

Re: Forget Fibonacci! Other interesting Sequences

Posted 07 June 2012 - 09:46 AM

View Postatraub, on 07 June 2012 - 02:02 AM, said:

The wikipedia article I linked says it better, "read off the digits of the previous member". Digits are always single values, so it would never be read as "one-twelve".



Unless you're working in hex... :)

Here, this oughta keep you busy for a while
Was This Post Helpful? 0
  • +
  • -

#6 atraub  Icon User is offline

  • Pythoneer
  • member icon

Reputation: 759
  • View blog
  • Posts: 2,010
  • Joined: 23-December 08

Re: Forget Fibonacci! Other interesting Sequences

Posted 07 June 2012 - 11:18 AM

Digit inherently implies base 10, it comes from the latin word for finger. If you're referring to hex-digits (which I couldn't find an official word for), then you'd be half right, but usually the hex digit for 12 is C. "12" is not a digit, it is a collection of digits. That's why if you're working in hex and you write "12" it really means 18 in base 10.

I looked at the integer encyclopedia a few weeks ago. It's nice, but it has a lot of sequences that are far from interesting. For example, the multiplicadditive sequence is boring and trivial at best. I looked through it, but I came across so many crap sequences I got bored and lost interest. It's like taking a metal detector to the beach: yes it's possible that you'll find something amazing, but you'll mainly find garbage.

Besides, there's no reason to limit yourself to only integer sequences. At the very least, the Cantor "game" is good food for thought on generating "thorough" floating point sequences.

This post has been edited by atraub: 07 June 2012 - 11:21 AM

Was This Post Helpful? 0
  • +
  • -

#7 jon.kiparsky  Icon User is online

  • Pancakes!
  • member icon


Reputation: 7572
  • View blog
  • Posts: 12,717
  • Joined: 19-March 11

Re: Forget Fibonacci! Other interesting Sequences

Posted 07 June 2012 - 11:29 AM

View Postatraub, on 07 June 2012 - 01:18 PM, said:

Digit inherently implies base 10, it comes from the latin word for finger. If you're referring to hex-digits (which I couldn't find an official word for), then you'd be half right, but usually the hex digit for 12 is C. "12" is not a digit, it is a collection of digits. That's why if you're working in hex and you write "12" it really means 18 in base 10.


Etymologically, the word digit is strongly "tennish", but the point is that the sequence depends entirely on the system of representation, not on the numbers themselves. If you can represent 12 as one character, C, then it's a different sequence - and if you can represent 35 as Z, it's something else entirely. (base 36? Why not?) Now imagine running this puzzle in Roman numerals :)


On that note, you might find this amusing.

This post has been edited by jon.kiparsky: 07 June 2012 - 11:30 AM

Was This Post Helpful? 0
  • +
  • -

#8 atraub  Icon User is offline

  • Pythoneer
  • member icon

Reputation: 759
  • View blog
  • Posts: 2,010
  • Joined: 23-December 08

Re: Forget Fibonacci! Other interesting Sequences

Posted 07 June 2012 - 11:37 AM

Given that the first part of the name is "look", it does make sense that representation matters. It's the oddness of the sequence that I find so fun. That blog post is very amusing, it certainly ties into the look-say sequence very nicely :)
Was This Post Helpful? 0
  • +
  • -

#9 atraub  Icon User is offline

  • Pythoneer
  • member icon

Reputation: 759
  • View blog
  • Posts: 2,010
  • Joined: 23-December 08

Re: Forget Fibonacci! Other interesting Sequences

Posted 08 June 2012 - 07:50 AM

Hey I just noticed something kinda funny. Think about what happens if you seed the look/say sequence with 22!

In testing this, I found an error in my snippet, here's the amended version that works properly
def lookSayGenerator(firstValue=1):
    """a generator to find look say values"""
    #handle the first two values to avoid coding these unique cases
    yield int(firstValue)
    if len(str(firstValue)) == 1:
        currentValue = "1"+str(firstValue)
        yield int(currentValue)	
    else:
        currentValue = str(firstValue)
    
    #generrator for all other values
    #currSub and prevSub are the sub-values within the string
    while True:
        nextValue = ""
        prevSub = currentValue[0]
        count = 1
        #look at each sub value within the current value
        for currentSub in currentValue[1:]:
            #if the currentSub is different from the previous one
            if currentSub != prevSub:
                #add the count and the previous sub value to next Value
                nextValue += str(count) + prevSub
                #reset count
                count = 1
                #only change previous subvalue if the current subValue changes
                prevSub = currentSub
            else:
                #if the previous subvalue and the current one are the same
                count += 1 #increment count

        nextValue += str(count)+ currentSub #handle adding the last subvalue to next value
        yield int(nextValue) #report the next value
        currentValue = nextValue #set things up for the next run through


This post has been edited by atraub: 08 June 2012 - 07:50 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1