(12C) Sums of Two Squares
|
01-06-2019, 05:07 AM
(This post was last modified: 01-06-2019 05:29 AM by Gamo.)
Post: #1
|
|||
|
|||
(12C) Sums of Two Squares
Which whole numbers are expressible as sums of two (integer) squares?
This program solve the Sums of Two Squares. [ X^2 + Y^2 = N ] Given N program will find pair of X,Y that equal to N where X ≤ Y ---------------------------------------------------------- Procedure: 1.) N [R/S] display X [X<>Y] Y continue [R/S] if it is more than one solution and continue until steps 2.) shown mean finish. 2.) N [R/S] display 0.000000000 then 0.00 indicate that "No Solution" ---------------------------------------------------------- Example: X^2 + Y^2 = 41 N = 41 41 [R/S] 4 [X<>Y] 5 [R/S] "0.000000000" 0.00 Answer: X = 4 and Y = 5 ---------------------------------------------------------- X^2 + Y^2 = 76789 N = 76789 76789 [R/S] 135 [X<>Y] 242 [R/S] 150 [X<>Y] 233 [R/S] "0.000000000" 0.00 Answer: X = 135 and Y = 242 X = 150 and Y = 233 ----------------------------------------------------------- Program: Code: Remark: Try this on 12C Emulator: N = 9876543210 Gamo |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)