1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
use ;
/// Calculates the nth lazy caterer number.
///
/// # Arguments
///
/// * `n` - A non-negative integer representing the position in the lazy caterer sequence.
///
/// # Returns
///
/// The nth lazy caterer number .
///
/// # Examples
///
/// ```
/// use numberlab::figurate::lazy_caterer::nth_lazy_caterer;
///
/// let result = nth_lazy_caterer(10);
/// assert_eq!(result, 56);
/// ```
/// Generates a sequence of lazy caterer numbers up to the given number `n`.
///
/// # Arguments
///
/// * `n` - A non-negative integer representing the number of terms in the lazy caterer sequence.
///
/// # Returns
///
/// A vector containing the lazy caterer sequence up to the given number `n`.
///
/// # Examples
///
/// ```
/// use numberlab::figurate::lazy_caterer::lazy_caterer_sequence;
///
/// let sequence = lazy_caterer_sequence(5);
/// assert_eq!(sequence, vec![1, 2, 4, 7, 11]);
/// ```