pub fn count(&mut self, n: usize) -> usize {
        if n == 0 {
            1
        } else if self.count_cache.contains_key(&n) {
            *self.count_cache.get(&n).unwrap()
        } else {
            let result = (self.fprod(n) + (1..n).fold(0, |sum, k| {
                sum + self.fprod(k) * self.count(n - k)
            })) / n;
            self.count_cache.insert(n, result);
            result
        }
    }
/// Count the number of prime partitions of `n`.
///
/// # Asserts
/// `n` <= PrimePartition::n
Count the number of prime partitions of `n`.
Count the number of prime partitions of ` n ` .
pub fn count(&mut self, n: usize) -> usize {
        if n == 0 {
            1
        } else if self.count_cache.contains_key(&n) {
            *self.count_cache.get(&n).unwrap()
        } else {
            let result = (self.fprod(n) + (1..n).fold(0, |sum, k| {
                sum + self.fprod(k) * self.count(n - k)
            })) / n;
            self.count_cache.insert(n, result);
            result
        }
    }
pub fn count ( & mut self , n : usize ) -> usize { if n == 0 { 1 } else if self . count_cache . contains_key ( & n ) { * self . count_cache . get ( & n ) . unwrap ( ) } else { let result = ( self . fprod ( n ) + ( 1 .. n ) . fold ( 0 , | sum , k | { sum + self . fprod ( k ) * self . count ( n - k ) } ) ) / n ; self . count_cache . insert ( n , result ) ; result } }
Count the number of prime partitions of `n`.
Count the number of prime partitions of ` n ` .
&mut self
n
usize
asserts
`n` <= PrimePartition::n
` n ` < = PrimePartition :: n