Jacobsthal numbers: Difference between revisions
m
→{{header|Haskell}}: Adjusted a type
m (→{{header|Haskell}}: Adjusted a type) |
|||
Line 841:
jacobsthal :: [Integer]
jacobsthal = jacobsthalish
jacobsthalish ::
jacobsthalish (x, y) = unfoldr go [x, y]
where
go (a : b : xs) = Just (a, b : xs <> [2 * a + b])
Line 861 ⟶ 859:
( "Jacobsthal-Lucas numbers",
30,
jacobsthalish
),
( "Jacobsthal oblong numbers",
|