The goal of this problem is to work the definition of infinite lists. In particular, you are required to define functions that generate infinite lists to:
Generate the sequence of ones .
Generate the sequence of the natural numbers .
Generate the sequence of the integer numbers .
Generate the sequence of the triangular numbers: .
Generate the sequence of the factorial numbers: .
Generate the sequence of the Fibonacci numbers: .
Generate the sequence of prime numbers: .
Generate the ordered sequence of the Hamming numbers: . The Hamming numbers are those that only have 2, 3 and 5 as prime divisors.
Generate the look-and-say sequence: .
Generate the sequences of rows of the Tartaglia triangle (also known as Pascal’s triangle): .
Define the following functions:
ones :: [Integer]
nats :: [Integer]
ints :: [Integer]
triangulars :: [Integer]
factorials :: [Integer]
fibs :: [Integer]
primes :: [Integer]
hammings :: [Integer]
lookNsay :: [Integer]
tartaglia :: [[Integer]]
In this problem you cannot use infinite enumerations such as , but you are advised to use higer-order functions such as map, scanl, iterate, filter, ...
Each function score 10 points.
Author: Unknown
Translator: Jordi Petit
Generation: 2026-02-03T17:04:41.803Z
© Jutge.org, 2006–2026.
https://jutge.org