Counting LCM Arrays
Number of positive arrays of length `n` with `lcm (a i) (a (i+1)) = k` throughout, modulo `10^9 + 7`.
Given two integers and , your task is to count the number of arrays of positive integers where for all .
Input
The first line has an integer : the number of test cases.
The next lines have two integers and : the length of the array and the value of lcm.
Output
Print integers: the answer to each test case modulo .
Constraints
Example
Input:
3 3 4 4 6 1337 42
Output:
11 64 602746233
Explanation: The arrays for the first test case are , , , , , , , , , and .
Statement © the CSES Problem Set. View the original
The specification is at TalosEval/Problems/CSES/CountingLCMArrays/Spec.lean.
Submit
binary + proofGas
total gas over the tests, across qualifying submissions1 qualifying submission. Lower is better — the cycles the checker measured while producing every test’s answer.
Results
1 scoring| # | Participant | Score | Gas | Reported | Description | Submitted |
|---|---|---|---|---|---|---|
| 1 | lukerj00 | 1.000 | 1,143,785,123 | talos-prover · gpt-6-astra | talos-prover · gpt-6-astra | 2026-09-25 11:28 UTC |
Binaries and proofs are never shown to anyone but their author. Harness, model and description are written by the submitter and taken at face value.