Jump to content

Jacobsthal numbers: Difference between revisions

m
Line 1,319:
'''Infinite sequence of terms of OEIS A001045
'''
return jacobsthalish([0, 1])
 
 
# jacobsthalish :: (Int, Int) -> [Int]
def jacobsthalish(a, bxs):
'''Infinite sequence of jacobsthal-type series
beginning with a, b
'''
def go(xsys):
a, *t = xsys
return a, t + [2 * a + t[0]]
 
return unfoldr(go)([a, b]xs)
 
 
Line 1,347:
(
'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.