Statistics

Problem Statement for "OneTwoThree"

Problem Statement

Find the smallest number that is divisible by all the integers between 1 and n, inclusive, and return it modulo 987654321.

Definition

Class:
OneTwoThree
Method:
minimalNumber
Parameters:
int
Returns:
int
Method signature:
int minimalNumber(int n)
(be sure your method is public)

Constraints

  • n will be between 1 and 100000, inclusive.

Examples

  1. 1

    Returns: 1

  2. 3

    Returns: 6

    The smallest number divisible by 1, 2 and 3 is just 1 * 2 * 3.

  3. 10

    Returns: 2520

  4. 1234

    Returns: 411860547

  5. 78932

    Returns: 858036087

  6. 3198

    Returns: 195852699

  7. 12345

    Returns: 643466592

  8. 65432

    Returns: 738252234

  9. 11

    Returns: 27720

  10. 12

    Returns: 27720

  11. 13

    Returns: 360360

  12. 14

    Returns: 360360

  13. 15

    Returns: 360360

  14. 16

    Returns: 720720

  15. 17

    Returns: 12252240

  16. 18

    Returns: 12252240

  17. 19

    Returns: 232792560

  18. 20

    Returns: 232792560

  19. 50

    Returns: 838897011

  20. 100

    Returns: 445989033

  21. 199

    Returns: 199577790

  22. 200

    Returns: 199577790

  23. 1000

    Returns: 378377874

  24. 10000

    Returns: 930624795

  25. 100000

    Returns: 210925494

  26. 987

    Returns: 79788276

  27. 123

    Returns: 91049076

  28. 97

    Returns: 445989033

  29. 23

    Returns: 415957275

  30. 29

    Returns: 200673882

  31. 31

    Returns: 294964416

  32. 99999

    Returns: 210925494

  33. 99643

    Returns: 458322210

  34. 99733

    Returns: 980800686

  35. 99787

    Returns: 84881034

  36. 99391

    Returns: 490681251

  37. 99611

    Returns: 297416547

  38. 99623

    Returns: 886686102

  39. 99707

    Returns: 842328648

  40. 99709

    Returns: 586668555

  41. 99713

    Returns: 703846206

  42. 99719

    Returns: 173148570

  43. 99721

    Returns: 375709248

  44. 99733

    Returns: 980800686

  45. 99989

    Returns: 292146921

  46. 99991

    Returns: 210925494

  47. 65536

    Returns: 974389221

  48. 65536

    Returns: 974389221

  49. 65536

    Returns: 974389221

  50. 97969

    Returns: 528039414

  51. 80089

    Returns: 105769665

  52. 54289

    Returns: 406801602


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: