Math Challenge

in math •  7 years ago 

The first 6 terms of a sequence are (0,1,2,3,4,5). Each subsequent term is the last digit of the sum of the six previous terms. In other words, the seventh term is 5, since 0+1+2+3+4+5 = 15. So, the eight term is 0, since 1+2+3+4+5+5 = 20.
Can the sub-sequence 13579 occur anywhere in this sequence?
serveimage.png

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

I wrote a little python script to do it for me:

l = (0,1,2,3,4,5)
hist = []
def getNext(l):
        return (l[1],l[2],l[3],l[4],l[5],int(str(sum(l))[-1]))

for i in range(100000):
        hist.append(l)
        l = getNext(l)
        print(l)
        if l in hist:
                print("DUPLICATE at {}".format(i))
                break
        if l == (1,3,5,7,9):
                print("FOUND IT")

After 1456 iterations of this loop, we come back to the original 6 terms of the sequence and we still haven't encountered 13579.

I have no good mathematical answer for why this is true though...which I assume there is?

Actually I'm still trying to solve this myself. I really like the code. There could be a sequence of 2x+1 starting with x=0 and going to x=4 that is past 1456 iterations. The way to prove it would be to find a recurring cycle and show that this cannot be part of the cycle. What I'm trying to do right now is see if it has any pattern to it.

That's what I'm saying I did...the code finds a cycle at the 1456th iteration

I can't Understand

Loading...