0 Replies - 1534 Views - Last Post: 10 May 2012 - 08:15 PM

#1 atraub   User is offline

  • Pythoneer
  • member icon

Reputation: 829
  • View blog
  • Posts: 2,250
  • Joined: 23-December 08

OEIS A019464: MultiplicAdditive Generator

Posted 10 May 2012 - 08:15 PM

Description: This generator models the mahematical sequence seen here http://oeis.org/A019464 you can also find it here: http://michaelhalm.t...d.com/id112.htm under multiplicadditive
__author__ = "atraub"
__date__= "5/11/2012"

def multiplicAdditiveGenerator(seed=1):
    """OEIS A019464: multiply by 1 add 1 multiply by 2, add 2, etc..."""
    val = 1
    yield seed
    while True:
        seed *= val
        yield seed
        seed += val
        yield seed
        val+=1



Is This A Good Question/Topic? 0
  • +

Page 1 of 1