This content is not available in your language yet.
Problem 932: 2025
For the year 2025
2025=(20+25)2
Given positive integers a and b, the concatenation ab we call a 2025-number if ab=(a+b)2.
Other examples are 3025 and 81.
Note 9801 is not a 2025-number because the concatenation of 98 and 1 is 981.
Let T(n) be the sum of all 2025-numbers with n digits or less. You are given T(4)=5131.
The problem asks for the sum of all “2025-numbers” up to 16 digits. A direct search is infeasible. We need to find a mathematical structure to generate these numbers efficiently.
The formula for a reveals a deep structural property. Since a must be an integer, s(s−1) must be divisible by 10k−1. This gives us a core congruence relation:
s(s−1)≡0(mod10k−1)
The numbers s and s−1 are always coprime (their GCD is 1). This means that for any prime power pe in the prime factorization of M=10k−1, pe must divide eithers or s−1, but not both.
This allows us to find all possible values of s modulo M. If M has r distinct prime factors, there are 2r solutions to this congruence, which can be found using the Chinese Remainder Theorem (CRT).
We can now formulate an algorithm to find all 2025-numbers up to 16 digits.
A pair (s,k) generates a valid 2025-number s2 if it satisfies all constraints:
The number of digits of s2 is at most 16. This implies s2<1016, which means s<108.
The number of digits of b is k. This means 10k−1≤b<10k.
a and b are positive integers. This implies s>1. The condition a≥1 combined with s>1 ensures b<s.
The range for k is also limited. Since a≥1, we must have s(s−1)≥10k−1, which implies s is roughly 10k=10k/2. Combining this with s<108, we get 10k/2≲108, which means k/2≲8, or k≲16. We will check k from 1 to 15.
The final algorithm is as follows:
Initialize an empty set, found_numbers, to store the valid s2 values and avoid duplicates.
Loop through the number of digits for b, k, from 1 to 15.
For each k, let M=10k−1.
Find the prime factorization of M.
For each prime power factor pe of M, we have two choices for a congruence: s≡0(modpe) or s≡1(modpe).
Generate all 2r systems of congruences (where r is the number of distinct prime factors).
For each system, use the Chinese Remainder Theorem to find the unique solution s modulo M.
For each solution s:
Check if s<108.
Calculate a=Ms(s−1) and b=s−a.
Check if b has exactly k digits: 10k−1≤b<10k.
If all conditions are met, add s2 to the found_numbers set.
After checking all k, the sum of the elements in found_numbers is the answer T(16).