Jacobsthal numbers: Difference between revisions

m
Line 1,783:
'''Infinite sequence of terms of OEIS A001045
'''
return jacobsthalish((0, 1))
 
 
# jacobsthalish :: (Int, Int) -> [Int]
def jacobsthalish(xyx, y):
'''Infinite sequence of jacobsthal-type series
beginning with a, b
Line 1,793:
def go(ab):
a, b = ab
return a, [(b, 2 * a + b])
 
return unfoldr(go)(xy(x, y))
 
 
Line 1,811:
(
'Jacobsthal-Lucas numbers',
30, jacobsthalish((2, 1))
),
(
9,655

edits