CT032

Regular Number Generator

HardAcceptance: 0.0%

A regular number in mathematics is one that evenly divides some power of 60. Equivalently, a regular number is one whose only prime divisors are 2, 3, and 5. Given an integer n, generate the first n regular numbers in ascending order.

Example 1:

Input: 10
Output: 1 2 3 4 5 6 8 9 10 12

Example 2:

Input: 5
Output: 1 2 3 4 5

Constraints:

1 <= n <= 10^4 Regular numbers fit in a 64-bit integer

Tags:

heap math
Loading...
Test Cases:No test cases
No test cases available.
Coding Problem Not Found | CodeTikki