Jacobsthal numbers: Difference between revisions
m
→{{header|Python}}
Line 1,319:
'''Infinite sequence of terms of OEIS A001045
'''
return jacobsthalish([0, 1])
# jacobsthalish :: (Int, Int) -> [Int]
def jacobsthalish(
'''Infinite sequence of jacobsthal-type series
beginning with a, b
'''
def go(
a, *t =
return a, t + [2 * a + t[0]]
return unfoldr(go)(
Line 1,347:
(
'Jacobsthal-Lucas numbers',
30, jacobsthalish([2, 1])
),
(
|