Jacobi Numbers
문제
Today, a new paper has been published in the Bulletin of Apocryphal Pioneers in Computation. According to this paper, the forgotten German number theorist Wahnfried Imaginus Jacobi (1806--1853), while still a secondary student in Potsdam, investigated the decomposition of integers into sums of cubes. Among the examples noted in the surviving fragments of his notebooks are \[ 2025 = 1^3 + 2^3 + 3^3 + 4^3 + 5^3 + 6^3 + 7^3 + 8^3 + 9^3 \] and the more curious expression \[ 3 = 1^3 + 1^3 + 1^3 = 4^3 + 4^3 + (-5)^3\,,\] which shows that a solution need not be unique. Jacobi restricted his attention to small integers and probably did not know the decomposition \[ 3 = 569\,936\,821\,221\,962\,380\,720^3 + (-569\,936\,821\,113\,563\,493\,509)^3 + (-472\,715\,493\,453\,327\,032)^3 \,,\] which was discovered only recently.1 However, Jacobi did manage to prove that a decomposition into cubes always exists for all positive integers up to , the th cuban prime of the first kind. Although his work was never published, references to the method appear in a marginal annotation in an 1823 letter to his famous brother Carl Gustav Jacob.
Given a positive integer , output a list of at most integers between and such that the sum of their cubes equals .
1Booker, Andrew R.; Sutherland, Andrew V. (2021), "On a question of Mordell", Proceedings of the National Academy of Sciences, 118 (11)
입력
The input consists of:
- One line with an integer (), the number to decompose into cubes.
출력
Output an integer (), the number of terms in your solution, followed by integers ( for each ), such that .
If there are multiple valid solutions, you may output any one of them.
예제
예제 1
2025
9 1 2 3 4 5 6 7 8 9
예제 2
45
3 2025 -2369 1709
예제 3
15
3 -1 2 2
예제 4
9241
2 -55 56