fermatWrong.frink

Download or view fermatWrong.frink in plain text format

/** Program to verify the (incorrect) Fermat's Library tweet:

    https://x.com/fermatslibrary/status/1813217704905474167

    which says:

    "This is the only solution to a² + b³ = c⁷ in positive integers
     15312283^2 + 9262^3 == 113^7"

    Augh.

    It uses the new faster sqrtNearestInteger function from the 2024-07-16
    release of Frink.
*/


for seven = 1 to 1001
{
   n = seven^7
   for three = 1 to floor[n^(1/3)]
   {
      n1 = n - three^3
      two = sqrtNearestInteger[n1]
      if n1 > 0 and two^2 == n1
         println["$two^2 + $three^3 == $seven^7"]
   }
}


Download or view fermatWrong.frink in plain text format


This is a program written in the programming language Frink.
For more information, view the Frink Documentation or see More Sample Frink Programs.

Alan Eliasen was born 20107 days, 23 hours, 31 minutes ago.