Statistics

Problem Statement for "FIELDDiagrams"

Problem Statement

A Ferrers diagram of the partition of positive number n = a1 + a2 + ... + ak, for a list a1, a2, ..., ak of k positive integers with a1 ≥ a2 ≥ ... ≥ ak is an arrangement of n boxes in k rows, such that the boxes are left-justified, the first row is of length a1, the second row is of length a2, and so on, with the kth row of length ak. Let's call a FIELD diagram of order fieldOrder a Ferrers diagram with a1 ≤ fieldOrder, a2 ≤ fieldOrder - 1, ..., ak ≤ fieldOrder - k + 1, so a FIELD diagram can have a number of rows which is less than or equal to fieldOrder. Your method will be given fieldOrder, it should return the total number of FIELD diagrams of order fieldOrder.

Definition

Class:
FIELDDiagrams
Method:
countDiagrams
Parameters:
int
Returns:
long
Method signature:
long countDiagrams(int fieldOrder)
(be sure your method is public)

Constraints

  • fieldOrder will be between 1 and 30, inclusive

Examples

  1. 2

    Returns: 4

    There are four possible FIELD diagrams for fieldOrder equal to 2, corresponding to partitions: (1), (2), (1, 1), (2,1). They are shown in the picture below. There white stands for unused space in a row and red for boxes, corresponding to FIELD diagrams.

  2. 3

    Returns: 13

  3. 5

    Returns: 131

  4. 10

    Returns: 58785

  5. 1

    Returns: 1

  6. 2

    Returns: 4

  7. 3

    Returns: 13

  8. 4

    Returns: 41

  9. 5

    Returns: 131

  10. 6

    Returns: 428

  11. 7

    Returns: 1429

  12. 8

    Returns: 4861

  13. 9

    Returns: 16795

  14. 10

    Returns: 58785

  15. 11

    Returns: 208011

  16. 12

    Returns: 742899

  17. 13

    Returns: 2674439

  18. 14

    Returns: 9694844

  19. 15

    Returns: 35357669

  20. 16

    Returns: 129644789

  21. 17

    Returns: 477638699

  22. 18

    Returns: 1767263189

  23. 19

    Returns: 6564120419

  24. 20

    Returns: 24466267019

  25. 21

    Returns: 91482563639

  26. 22

    Returns: 343059613649

  27. 23

    Returns: 1289904147323

  28. 24

    Returns: 4861946401451

  29. 25

    Returns: 18367353072151

  30. 26

    Returns: 69533550916003

  31. 27

    Returns: 263747951750359

  32. 28

    Returns: 1002242216651367

  33. 29

    Returns: 3814986502092303

  34. 30

    Returns: 14544636039226908


This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2024, TopCoder, Inc. All rights reserved.
This problem was used for: