[Python] How can I find positive integers n,k,x such that a symmetric fourth-power equation is...

Discussão em 'Python' iniciado por Stack, Julho 10, 2025.

  1. Stack

    Stack Membro Participativo

    I'm working on a mathematical problem that involves the following identity, and I want to find positive integers, k,n,x such that all four terms in the equation are perfect fourth powers and the equation holds exactly.

    -1/2 * ((1/3)^(1/3) * n)^2 / ( (3n^3 - 3(n^4 - x)/n + sqrt((1/3)n^8 + 9x^2)/n)^(1/3) )
    + 1/2 * n
    + 1/2 * (1/3)^(1/3) * (3n^3 - 3(n^4 - x)/n + sqrt((1/3)n^8 + 9x^2)/n)^(1/3)
    )^4
    +
    (
    -1/2 * (1/3)^(2/3) * k^2 / ( (3k^3 - 3(k^4 - x)/k + sqrt((1/3)k^8 + 9x^2)/k)^(1/3) )
    - 1/2 * k
    + 1/2 * (1/3)^(1/3) * (3k^3 - 3(k^4 - x)/k + sqrt((1/3)k^8 + 9x^2)/k)^(1/3)
    )^4
    =
    (
    -1/2 * ((1/3)^(1/3) * n)^2 / ( (3n^3 - 3(n^4 - x)/n + sqrt((1/3)n^8 + 9x^2)/n)^(1/3) )
    - 1/2 * n
    + 1/2 * (1/3)^(1/3) * (3n^3 - 3(n^4 - x)/n + sqrt((1/3)n^8 + 9x^2)/n)^(1/3)
    )^4
    +
    (
    -1/2 * (1/3)^(2/3) * k^2 / ( (3k^3 - 3(k^4 - x)/k + sqrt((1/3)k^8 + 9x^2)/k)^(1/3) )
    + 1/2 * k
    + 1/2 * (1/3)^(1/3) * (3k^3 - 3(k^4 - x)/k + sqrt((1/3)k^8 + 9x^2)/k)^(1/3)
    )^4



    This identity appears complicated but is structurally symmetric and actually resembles a taxicab-type identity for fourth powers. It seems to reduce the usual 4-variable search space for equal fourth-power sums into just 3 variables: k,n,x .

    I want to write Python code that: *Searches over positive integers n,k,x, *Checks whether each of the 4 expressions evaluates to a positive integer *Verifies that each of the 4 terms is a perfect fourth power *Confirms that the equation balances to machine precision

    When:

    n = 24, k = 74, x = 300783360

    The equation becomes:

    158^4 + 59^4 = 134^4 + 133^4

    Each term's 4th root is an exact integer, so this is a valid solution.

    I also tried these codes which yielded integer values for k,n,x, which while they did satisfy the equation above, they did not do so such that the fourth root of each of the four terms that make up the above equation in total,were not positive non-zero integers. Also, while the error was negligible, it was still not zero as can be seen below.

    You can view the full code here: My Python Gist

    What I’m asking:


    1. How can I ensure that my Python code finds integer solutions for k,n,x such that all 4 terms are perfect fourth powers?


    2. Is there a better way (e.g., using mpmath or sympy) to symbolically or precisely evaluate this equation to avoid floating-point drift?


    3. Are there better numerical or algebraic strategies to speed up or validate such searches?

    Any help or feedback is greatly appreciated!

    Continue reading...

Compartilhe esta Página