#P15430. [蓝桥杯 2025 国 Python B] 等差数列计数
[蓝桥杯 2025 国 Python B] 等差数列计数
Problem Description
An arithmetic progression is a common mathematical sequence where the difference between any two adjacent terms is a fixed constant, called the common difference. For example, is an arithmetic progression with common difference , while is not an arithmetic progression. Now, Xiaolan wants to know: if you choose distinct numbers from the integers from to , how many different arithmetic progressions of length can be formed? Two arithmetic progressions are different if and only if they differ in at least one term. For example, and are different arithmetic progressions, and and are also different arithmetic progressions.
Output Format
This is an answer-only problem. You only need to compute the result and submit it. The result is an integer. When submitting your answer, fill in only this integer; any extra content will not receive points.
Hint
Translated by ChatGPT 5