Jacobsthal numbers: Difference between revisions
Content added Content deleted
m (→{{header|Python}}: Simplified definition of a function over a tuple) |
|||
Line 1,912: | Line 1,912: | ||
# jacobsthalish :: (Int, Int) -> [Int] |
# jacobsthalish :: (Int, Int) -> [Int] |
||
def jacobsthalish( |
def jacobsthalish(*xy): |
||
'''Infinite sequence of jacobsthal-type series |
'''Infinite sequence of jacobsthal-type series |
||
beginning with a, b |
beginning with a, b |
||
Line 1,920: | Line 1,920: | ||
return a, (b, 2 * a + b) |
return a, (b, 2 * a + b) |
||
return unfoldr(go)( |
return unfoldr(go)(xy) |
||