Sequence of multiples
Medium
Execution time limit is 3 seconds
Runtime memory usage limit is 64 megabytes
In the sequence of natural numbers A[1]
, A[2]
, A[3]
,..., each term A[k]
is defined as the smallest natural number that is divisible by all of the first k natural numbers: 1, 2, 3, ..., k. Given a natural number N, determine the smallest k such that the sequence contains N consecutive identical numbers starting from A[k]
.
Input: A natural number N (N < 100).
Output: The smallest k for which the sequence has N consecutive identical terms starting from A[k]
.
Examples
Input #1
Answer #1
Submissions 298
Acceptance rate 15%