0 Replies - 1481 Views - Last Post: 12 July 2012 - 11:51 AM

#1 atraub   User is offline

  • Pythoneer
  • member icon

Reputation: 833
  • View blog
  • Posts: 2,257
  • Joined: 23-December 08

Collatz Conjecture Generator

Posted 12 July 2012 - 11:51 AM

Description: This is a generator for finding values from the collatz conjecture from a given seed.
__author__ = "atraub"
__date__= "6/10/2012"

def collatz(num):
    while num != 1:
        if num%2:
            num=(num*3)+1
        else:
            num /= 2
        yield num

Is This A Good Question/Topic? 0
  • +

Page 1 of 1