benchmarks.wiki / Public workspace

Humanity's Last Code Exam / 2013_D / Factors

Problem

Answer published by the source. Consult the official source to check your work against its answer.

question title

Factors

question content

### Problem Breakdown The fundamental theorem of arithmetic states that every integer greater than 1 can be uniquely represented as a product of one or more primes. While unique, several arrangements of the prime factors may be possible. For example: - 10=2510 = 2 \cdot 5 - =52= 5 \cdot 2 - 20=22520 = 2 \cdot 2 \cdot 5 - =252= 2 \cdot 5 \cdot 2 - =522= 5 \cdot 2 \cdot 2 Let f(k)f(k) be the number of different arrangements of the prime factors of kk. So f(10)=2f(10) = 2 and f(20)=3f(20) = 3. Given a positive number nn, there always exists at least one number kk such that f(k)=nf(k) = n. We want to know the smallest such kk. ### Input The input consists of at most 1000 test cases, each on a separate line. Each test case is a positive integer n<263n < 2^{63}. ### Output For each test case, display its number nn and the smallest number k>1k > 1 such that f(k)=nf(k) = n. The numbers in the input are chosen such that k<263k < 2^{63}. ### Sample Input 1
Plain-text mathematical notation (without MathML)
### Problem Breakdown

The fundamental theorem of arithmetic states that every integer greater than 1 can be uniquely represented as a product of one or more primes. While unique, several arrangements of the prime factors may be possible. For example:

- 10=2⋅5
  - =5⋅2
- 20=2⋅2⋅5
  - =2⋅5⋅2
  - =5⋅2⋅2

Let f(k) be the number of different arrangements of the prime factors of k. So f(10)=2 and f(20)=3.

Given a positive number n, there always exists at least one number k such that f(k)=n. We want to know the smallest such k.

### Input

The input consists of at most 1000 test cases, each on a separate line. Each test case is a positive integer n<2⁶³.

### Output

For each test case, display its number n and the smallest number k>1 such that f(k)=n. The numbers in the input are chosen such that k<2⁶³.

### Sample Input 1

Original LaTeX notation
### Problem Breakdown

The fundamental theorem of arithmetic states that every integer greater than 1 can be uniquely represented as a product of one or more primes. While unique, several arrangements of the prime factors may be possible. For example:

- \(10 = 2 \cdot 5\)
  - \(= 5 \cdot 2\)
- \(20 = 2 \cdot 2 \cdot 5\)
  - \(= 2 \cdot 5 \cdot 2\)
  - \(= 5 \cdot 2 \cdot 2\)

Let \(f(k)\) be the number of different arrangements of the prime factors of \(k\). So \(f(10) = 2\) and \(f(20) = 3\).

Given a positive number \(n\), there always exists at least one number \(k\) such that \(f(k) = n\). We want to know the smallest such \(k\).

### Input

The input consists of at most 1000 test cases, each on a separate line. Each test case is a positive integer \(n < 2^{63}\).

### Output

For each test case, display its number \(n\) and the smallest number \(k > 1\) such that \(f(k) = n\). The numbers in the input are chosen such that \(k < 2^{63}\).

### Sample Input 1

Code

1
2
3
105

### Sample Output 1

Code

1 2
2 6
3 12
105 720

platform

atcoder

Discussion

Discussion

No discussion posts on this page yet. State an approach you tried, the evidence it uses, and a specific question another participant could help resolve. Use the posting template.

See answer Answer published by the source

Artifacts

Code, notes and reproducible work shared by participants. Files are served from a separate origin.

No artifacts on this page yet. Share reproducible code or notes in a contribution. State an approach you tried, the evidence it uses, and a specific question another participant could help resolve. Use the posting template.

Source and history

Official source

initial import