0 ratings0% found this document useful (0 votes)

1K views2 pageshttp://www.gmannickg.com/?p=40

© Attribution Non-Commercial (BY-NC)

PDF or read online from Scribd

http://www.gmannickg.com/?p=40

Attribution Non-Commercial (BY-NC)

0 ratings0% found this document useful (0 votes)

1K views2 pageshttp://www.gmannickg.com/?p=40

Attribution Non-Commercial (BY-NC)

You are on page 1of 2

Let a, b, and c be distinct positive real numbers such that a + b = x2 , a + c = y 2 , and b + c = z 2 , where x, y, and z are integers. Find the minimum 2 2 2 value of a + b + c = x +y +z . 2 First note that x2 , y 2 , and z 2 are all unique1 . Without loss of generalization, let x2 < y 2 < z 2 , then iterate incrementally over the perfect squares (ordering by the sum of the squares) until all the constraints are satised: x2 1 1 1 4 4 4 9 9 9 16 y2 4 4 9 9 9 16 16 16 25 25 z2 9 16 16 16 25 25 25 36 36 36

a 2

11 2

b 3

13 2

c 6

19 2

Sum 7

21 2

Valid No No No No No No No No No Yes

3

3 2

4

11 2

12

21 2

13

29 2

6

5 2

10

13 2

15

37 2

19

45 2

0

11 2

9

29 2

16

43 2

25

61 2

1

5 2

10

27 2

26

45 2

35

77 2

At the tenth iteration the rst valid conguration occurs, and the problem is solved. The Haskell program to generate tables is listed below:

1 Let x2 = y 2 = S, then a + b = S and a + c = S, ergo b = c, a contradiction. Therefore x2 = y 2 . Similar argument for the other pairings.

-- Warning : I m an idiot and I m learning Haskell , code may suck . import Ratio -- Pretty - format a fraction strFraction _ 0 = error " Division by zero . " strFraction 0 _ = " 0 " strFraction n 1 = show n strFraction n d = show n ++ " / " ++ show d -- Pretty - print a fraction , reducing the fraction strFractionReduced n d = let x = n % d in strFraction ( numerator x ) ( denominator x ) -- Solve system strValueA x y z strValueB x y z strValueC x y z strSumABC x y z of equations = strFractionReduced = strFractionReduced = strFractionReduced = strFractionReduced

(x (z (y (x

z y x y

+ + + +

y) x) z) z)

2 2 2 2

-- Check if A , B , and C are positive isValid x y z = ( x - z + y ) > 0 && ( z - y + x ) > 0 && ( y - x + z ) > 0 -- - Full test strTriple x y z = " X ^2= " ++ show x ++ " Y ^2= " ++ show y ++ " Z ^2= " ++ show z ++ " A = " ++ ( strValueA x y z ) ++ " B = " ++ ( strValueB x y z ) ++ " C = " ++ ( strValueC x y z ) ++ " Sum = " ++ ( strSumABC x y z ) ++ " Valid : " ++ show ( isValid x y z ) -- Power " bases " , square root of the perfect square sequence -- X : 1 , 1 , 1 , 2 , 2 , 2 , 3 , 3 , 3 , ... -- Y : 2 , 2 , 3 , 3 , 3 , 4 , 4 , 4 , 5 , ... -- Z : 3 , 4 , 4 , 4 , 5 , 5 , 5 , 6 , 6 , ... xPowerBase n = n quot 3 + 1 yPowerBase n = xPowerBase ( n + 4) zPowerBase n = yPowerBase ( n + 4) -- Actual perfect squares -- X : 1 , 1 , 4 , 4 , 9 , 9 , ... -- Y : 4 , 4 , 9 , 9 , 16 , 16 , ... -- Z : 9 , 16 , 16 , 25 , 25 , 36 , ... xPower n = ( xPowerBase n )^2 yPower n = ( yPowerBase n )^2 zPower n = ( zPowerBase n )^2 -- Generate table testIterations n = mapM_ putStrLn [ show n ++ " : " ++ strTriple ( xPower n ) ( yPower n ) ( zPower n ) ++ " \ n " | n <- [0.. n ]]

Skip section### Trending

- Models: Attract Women Through HonestyMark Manson
- To All the Boys I've Loved BeforeJenny Han
- Crush It!: Why Now Is the Time to Cash in on Your PassionGary Vaynerchuk
- Boundaries: When to Say Yes, How to Say NoHenry Cloud
- Good to Great: Why Some Companies Make the Leap...And Others Don'tJim Collins
- City of Lost Souls: The Mortal Instruments, Book FiveCassandra Clare
- A Dog Is a DogStephen Shaskan
- Chicken BigKeith Graves
- RadianceGrace Draven
- Evil Spy SchoolStuart Gibbs
- Brown Bear, Brown Bear, What Do You See?Bill Martin, Jr.
- The Achievement Habit: Stop Wishing, Start Doing, and Take Command of Your LifeBernard Roth
- Wizard and Glass: The Dark Tower IVStephen King
- Orphan XGregg Hurwitz
- Braiding Sweetgrass: Indigenous Wisdom, Scientific Knowledge and the Teachings of PlantsRobin Wall Kimmerer
- On the Banks of Plum CreekLaura Ingalls Wilder
- Always and Forever, Lara JeanJenny Han
- The OverstoryRichard Powers
- It's Not Supposed to Be This Way: Finding Unexpected Strength When Disappointments Leave You ShatteredLysa TerKeurst
- My Favorite Half-Night StandChristina Lauren
- Real FriendsShannon Hale
- Can't Hurt Me: Master Your Mind and Defy the OddsDavid Goggins
- Love on Lexington AvenueLauren Layne
- Feels Like FallingKristy Woodson Harvey