Jump to content

Jacobsthal numbers: Difference between revisions

m
Line 1,320:
'''Infinite sequence of terms of OEIS A001045
'''
return jacobsthalish([(0, 1]))
 
 
# jacobsthalish :: (Int, Int) -> [Int]
def jacobsthalish(xsab):
'''Infinite sequence of jacobsthal-type series
beginning with a, b
'''
def go(ysxs):
a, *t = ysxs
return a, t + [2 * a + t[0]]
 
return unfoldr(go)(xslist(ab))
 
 
Line 1,348:
(
'Jacobsthal-Lucas numbers',
30, jacobsthalish([(2, 1]))
),
(
9,655

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.