Puzzle
5 minute read

Ponder This Challenge - June 2024 - Pythagorean triple approximations to pi

This riddle was suggested by Asaf Zimmerman - thanks, Asaf!

(A,B,C)(A,B,C) is called a Pythagorean triple if A,B,CA, B, C are positive integers and A2+B2=C2A^2+B^2=C^2.

For example, (3,4,5),(24,7,25),(20,21,29),(3,4,5), (24,7,25), (20,21,29), and (1333,444,1405)(1333,444,1405) are all Pythagorean triples.

We know that there's no triple such that AB=π\frac{A}{B}=\pi, because π\pi is irrational, but we can try to get close to that. The triple (24,7,25)(24,7,25) approximates π\pi, but not very well, because 2473.4285\frac{24}{7}\approx 3.4285, so 247π<0.3\left|\frac{24}{7}-\pi\right|<0.3, but not 247π<101\left|\frac{24}{7}-\pi\right|<10^{-1}.

Your goal Find a Pythagorean triple (A,B,C)(A,B,C) of numbers with 100 digits or less, such that ABπ<1020\left|\frac{A}{B}-\pi\right|<10^{-20}.

Give your solution in the format
A = 24
B = 7
C = 25

A bonus "*" will be given for finding a Pythagorean triple (D,E,F)(D,E,F) of numbers with 100 digits or less, such that DEπ<1095\left|\frac{D}{E}-\pi\right|<10^{-95}. Give your solution in the same format as above.


We will post the names of those who submit a correct, original solution! If you don't want your name posted then please include such a statement in your submission!

We invite visitors to our website to submit an elegant solution. Send your submission to the ponder@il.ibm.com.

If you have any problems you think we might enjoy, please send them in. All replies should be sent to: ponder@il.ibm.com

Solution

  • June 2024 Solution:

    A solution for both parts is

    A = 15780182746062370108602577733859373821827076136375073529796834518989107000489444222482943168070296
    B = 5022988173858530362046589594815862687165616836922409678904106986969714780309239151669666891661530
    C = 16560331448791934658922466325941893817186620274329261880232738682297512949234184663822339667675754
    

    A generally useful approach for finding rational approximations of numbers is using continued fractions. Given the infinite continued fraction form of a number, one can obtain rational approximations from its convergents - the rational numbers obtained by taking a finite prefix of the continued fraction and computing it. The approximations obtained this way are the best approximations possible for fractions with denominator which is smaller or equal to the one in the approximation.

    However, using the continued fraction approach on π\pi would not yield approximations that are also a part of a Pythagorean triple. To ensure we have such a triple, we use Euclid's method (from "Elements" book X, proposition 29): given two integers, s,ts,t we can generate a triple by

    • A=s2t2A = s^2-t^2
    • B=2stB = 2st
    • C=s2+t2C = s^2+t^2

    Fix ss. We are interested in finding the value of tt such that AB=s2t22st=π\frac{A}{B}=\frac{s^2-t^2}{2st}=\pi. This leads to the simple quadratic equation

    • t2+(2sπ)ts2=0t^2+(2s\pi)t-s^2=0

    With the positive solution t=sDt=s\cdot D with D=π2+1πD=\sqrt{\pi^2+1}-\pi. Thus, a pair s,ts,t such that ts=D\frac{t}{s}=D will give a perfect approximation to π\pi, but since we need s,ts,t to be integers and DD is irrational, we have to settle for an approximation; using the continued fraction method for DD gives good approximations, solving the riddle.

Solvers

  • *Lazar Ilic (31/5/2024 10:57 AM IDT)
  • *Jiri Spitalsky (31/5/2024 11:41 AM IDT)
  • *Bertram Felgenhauer (31/5/2024 2:23 PM IDT)
  • *Guglielmo Sanchini (31/5/2024 2:45 PM IDT)
  • Dan Dima (31/5/2024 4:24 PM IDT)
  • Giorgos Kalogeropoulos (31/5/2024 4:29 PM IDT)
  • Richard Gosiorovsky (31/5/2024 5:32 PM IDT)
  • *Hugo Pfoertner (31/5/2024 5:37 PM IDT)
  • *Yan-Wu He (31/5/2024 5:53 PM IDT)
  • *Yi Jiang (31/5/2024 9:17 PM IDT)
  • *Harald Bögeholz (31/5/2024 10:07 PM IDT)
  • *David Greer (31/5/2024 10:13 PM IDT)
  • Arthur Vause (31/5/2024 10:14 PM IDT)
  • *Bert Dobbelaere (1/6/2024 12:05 AM IDT)
  • *Serge Batalov (1/6/2024 12:25 AM IDT)
  • *Sanandan Swaminathan (1/6/2024 5:16 AM IDT)
  • *Karl Mahlburg (1/6/2024 6:06 AM IDT)
  • *Marco Bellocchi (1/6/2024 4:05 PM IDT)
  • *Daniel Chong Jyh Tar (1/6/2024 7:06 PM IDT)
  • *King Pig (1/6/2024 8:25 PM IDT)
  • *Mark Beyleveld (1/6/2024 11:51 PM IDT)
  • *Blaine Hill (2/6/2024 1:57 AM IDT)
  • *Kurt Foster (2/6/2024 3:18 AM IDT)
  • Rashid Naimi (2/6/2024 6:21 AM IDT)
  • Gary M. Gerken (2/6/2024 8:15 AM IDT)
  • *Oscar Volpatti (2/6/2024 9:35 AM IDT)
  • *Albert Stadler (2/6/2024 9:46 AM IDT)
  • Emmanuel Lazard (2/6/2024 3:42 PM IDT)
  • *Mathias Schenker (2/6/2024 4:39 PM IDT)
  • *Andrew Gauld (2/6/2024 5:19 PM IDT)
  • Julian Ma (2/6/2024 6:31 PM IDT)
  • Dieter Beckerle (2/6/2024 7:16 PM IDT)
  • *Juergen Koehl (2/6/2024 9:11 PM IDT)
  • *Guangxi Liu (3/6/2024 7:53 AM IDT)
  • *Alper Halbutogullari (3/6/2024 8:11 AM IDT)
  • *Vladimir Volevich (3/6/2024 1:13 PM IDT)
  • *Dan Dima (3/6/2024 2:36 PM IDT)
  • *Lorenz Reichel (3/6/2024 3:36 PM IDT)
  • *Dan Ismailescu (3/6/2024 11:07 PM IDT)
  • *Justin Snopek (3/6/2024 11:59 PM IDT)
  • Phil Proudman (4/6/2024 2:35 AM IDT)
  • *Cameron Ritson (4/6/2024 5:30 AM IDT)
  • José Eduardo Gaboardi de Carvalho (4/6/2024 5:31 AM IDT)
  • *Tim Walters (4/6/2024 9:09 AM IDT)
  • *Paul Lupascu (4/6/2024 3:06 PM IDT)
  • *Joaquim Carrapa (4/6/2024 5:44 PM IDT)
  • *Amos Guler (4/6/2024 6:50 PM IDT)
  • *John Tromp (4/6/2024 8:08 PM IDT)
  • *Latchezar Christov (4/6/2024 9:06 PM IDT)
  • Christoph Baumgarten (4/6/2024 11:31 PM IDT)
  • *Lu Wang (5/6/2024 12:12 AM IDT)
  • *Jan Fricke (5/6/2024 12:41 AM IDT)
  • *Arthur Vause (5/6/2024 10:23 AM IDT)
  • Nivrutti Tambe (5/6/2024 4:26 PM IDT)
  • Loukas Sidiropoulos (5/6/2024 5:36 PM IDT)
  • *Reiner Martin (5/6/2024 10:31 PM IDT)
  • Michael Liepelt (5/6/2024 11:04 PM IDT)
  • *Kipp Johnson (5/6/2024 11:34 PM IDT)
  • *Zheng Yu (6/6/2024 4:37 AM IDT)
  • *Xiao Liu (6/6/2024 6:31 AM IDT)
  • *Daniel Bitin (6/6/2024 10:47 AM IDT)
  • *Sachal Mahajan (7/6/2024 12:54 AM IDT)
  • *Evan Semet (7/6/2024 1:36 AM IDT)
  • *Wolfgang Kais (7/6/2024 2:31 PM IDT)
  • *Hakan Summakoğlu (7/6/2024 5:44 PM IDT)
  • *Ido Meisner (7/6/2024 6:04 PM IDT)
  • *Keith Kaplan (8/6/2024 4:27 AM IDT)
  • Paul Revenant (8/6/2024 11:24 AM IDT)
  • *Andrea Andenna (8/6/2024 5:28 PM IDT)
  • *Alex Izvalov (8/6/2024 10:22 PM IDT)
  • *Mark Pervovskiy (9/6/2024 2:24 AM IDT)
  • *David F.H. Dunkley (9/6/2024 2:33 AM IDT)
  • Shirish Chinchalkar (9/6/2024 3:41 AM IDT)
  • *Eden Saig (9/6/2024 10:24 AM IDT)
  • Fabio Michele Negroni (9/6/2024 3:23 PM IDT)
  • Thomas Egense (10/6/2024 4:13 PM IDT)
  • Karl-Heinz Hofmann (10/6/2024 8:26 PM IDT)
  • *Martin Thorne (10/6/2024 9:48 PM IDT)
  • *Matt Cristina (10/6/2024 9:48 PM IDT)
  • Guillaume Dujardin (11/6/2024 1:35 AM IDT)
  • *Hansraj Nahata (11/6/2024 4:09 AM IDT)
  • Piyush Agrawal (11/6/2024 2:22 PM IDT)
  • *Victor Chang (11/6/2024 3:06 PM IDT)
  • *Daniel Copeland (11/6/2024 11:34 PM IDT)
  • *Benjamin Cha (13/6/2024 1:07 AM IDT)
  • *Andreas Stiller (13/6/2024 2:27 AM IDT)
  • *Kay Lee (13/6/2024 3:06 AM IDT)
  • *Lawrence Au (13/6/2024 8:02 PM IDT)
  • *Dezhi Zhao (13/6/2024 11:55 PM IDT)
  • *Kevin Bauer (14/6/2024 1:48 AM IDT)
  • *Dieter Beckerle (14/6/2024 7:49 AM IDT)
  • Aviv Nisgav (15/6/2024 11:35 PM IDT)
  • Stefan Wirth (16/6/2024 5:06 PM IDT)
  • Adrian Neacsu (17/6/2024 1:21 AM IDT)
  • Andreas Knüpfer (17/6/2024 5:08 PM IDT)
  • *Erik Hostens (18/6/2024 5:32 PM IDT)
  • *Dillon Davis (18/6/2024 6:45 PM IDT)
  • *Li Li (20/6/2024 1:47 AM IDT)
  • *Ganghun Kim (20/6/2024 4:40 PM IDT)
  • *Kang Jin Cho (20/6/2024 8:22 PM IDT)
  • *Govind Jujare (20/6/2024 8:56 PM IDT)
  • *Zoltan Haindrich (21/6/2024 5:15 PM IDT)
  • Wenjie Yang (21/6/2024 11:39 PM IDT)
  • *Logan Dooley (22/6/2024 6:49 PM IDT)
  • Rudy Cortembert (23/6/2024 4:50 PM IDT)
  • Todd Will (23/6/2024 9:58 PM IDT)
  • Björn Hendriks (24/6/2024 3:42 AM IDT)
  • *Pål Hermunn Johansen (24/6/2024 4:47 PM IDT)
  • *Eran Vered (24/6/2024 6:49 PM IDT)
  • Nyles Heise (26/6/2024 4:29 AM IDT)
  • Stéphane Higueret (26/6/2024 8:01 AM IDT)
  • *Alain Michiels (26/6/2024 12:47 PM IDT)
  • Robin Guilliou (26/6/2024 1:51 PM IDT)
  • Deepak Bal (27/6/2024 10:33 PM IDT)
  • *Yunkyu (Luke) Lee (28/6/2024 5:57 PM IDT)
  • *Sofia Kozlova (29/6/2024 1:53 AM IDT)
  • *Suyeong Hahn (29/6/2024 5:02 PM IDT)
  • *Lorcan O'Connor (30/6/2024 12:19 AM IDT)
  • *Franciraldo Cavalcante (30/6/2024 6:53 AM IDT)
  • Erik Wünstel (30/6/2024 8:27 PM IDT)
  • *Motty Porat (30/6/2024 11:28 PM IDT)
  • Jeffrey Curtis (1/7/2024 7:24 AM IDT)
  • Thomas Watson & Steffan Môn & Joshua Burland & Vishva Patel (2/7/2024 4:24 PM IDT)
  • Radu-Alexandru Todor (4/7/2024 2:27 AM IDT)
  • *Nicholas Daskalovic (4/7/2024 6:05 AM IDT)
  • *Jared Kittleson (4/7/2024 4:35 PM IDT)

Related posts