26
$\begingroup$

Given the numbers 1, 2, ..., n the puzzle is to try to make a number as close as possible to pi using only the four mathematical operations +, -, *, / and parentheses (brackets). You don't have to use all the numbers and you are not allowed to stick digits together to make new numbers for example.

  • So if n = 1 the best answer is 1, clearly.
  • For n = 2 it is 3. For n = 3 it is also 3 and for n = 4 it is 3 + 1/(2*4) = 3.125.
  • For n = 8 you can do 3 + 1/(7 + 2/(4 * 8))= 355/113.

Give your best answer for n = 1 up to 20. That is, give a possibly different answer for each n up to 20.

$\endgroup$
9
  • 3
    $\begingroup$ This might help 🙂 Interesting puzzle! $\endgroup$ Commented Jun 23, 2023 at 8:39
  • $\begingroup$ Ah okay, haha. Though, as an answer already suggests, we might get better results than just using a single fraction $\endgroup$ Commented Jun 23, 2023 at 11:08
  • 1
    $\begingroup$ related: some of the content of this web page from 2004 $\endgroup$
    – Rosie F
    Commented Jun 26, 2023 at 7:27
  • 1
    $\begingroup$ @Simd Should a community wiki be made to compile all of the answers into one place so they all aren't spread across multiple answers? We would still be able to keep all of the current answers. $\endgroup$
    – CrSb0001
    Commented Jan 3 at 14:39
  • 1
    $\begingroup$ @Simd I could create the community wiki. All it would take for me is to click "Post another answer" and then create the wiki, which I'm currently working on doing. :) $\endgroup$
    – CrSb0001
    Commented Jan 3 at 14:55

7 Answers 7

22
$\begingroup$

Answer for n=20:

3 + 1/(7 + (6-5)/(15 + 2/((10-8) + (11-9)/(20*14+12+(17+16)/(13*4)))))

$$p = 3 + \cfrac{1}{ 7 + \cfrac{6-5}{ 15 + \cfrac{2}{ (10-8) + \cfrac{11-9}{ (20 \times 14 + 12) + \cfrac{17+16}{13 \times 4} } } } } $$

Uses all numbers except 18 and 19. Accuracy:

$$p = 3.141592653589\;81538324\cdots \\ \pi =3.141592653589\;79323846\cdots$$

Edit: Got the same fraction for n=19:

3 + 1/(7 + (10-9)/(15 + 2/((8-6) + (14-12)/(18*16+5-19/(13*4)))))

I got this expression using

the continued fraction expansion of $\pi$, truncated at 12 terms, i.e. $[3; 7, 15, 1, 292, 1, 1, 1, 2, 1, 3, 1]$. The next term is $14$, which makes $p$ accurate at its level.

$\endgroup$
2
  • 8
    $\begingroup$ Wow! This is very impressively accurate $\endgroup$
    – Simd
    Commented Jun 23, 2023 at 9:47
  • 5
    $\begingroup$ Given that it uses all numbers except 18 and 19, you can just multiply it all by ($19 - 18$) if you want to use all the numbers. $\endgroup$ Commented Oct 26, 2023 at 15:40
12
$\begingroup$
n = 1: 1                                                        (error = 2.14e0)
n = 2: 1 + 2 = 3                                                (error = 1.42e-2)
n = 3: 3                                                        (error = 1.42e-1)
n = 4: 3 + 1 / (2 * 4)               = 25/8    = 3.125          (error = 1.66e-2)
n = 5: 3 + 1 / (2 + 5)               = 22/7    = 3.14285...     (error = 1.26e-3)
n = 6: 3 + (1 / 6 + 2 / 5) / 4       = 377/120 = 3.141666...    (error = 7.40e-5)
n = 7: (same as n = 6)
n = 8: 3 + (2 * 8) / (6 * 4 * 5 - 7) = 355/113 = 3.141592920... (error = 2.67e-7)
n = 9: (same as n = 8)
$\endgroup$
3
  • 3
    $\begingroup$ How did you find them? $\endgroup$
    – Simd
    Commented Jun 25, 2023 at 16:23
  • 6
    $\begingroup$ @Simd Exhaustive search. I hope to improve my methods to get up to n = 10. $\endgroup$ Commented Jun 25, 2023 at 17:00
  • $\begingroup$ Is 10 out of reach? $\endgroup$
    – Simd
    Commented Jul 20, 2023 at 7:37
10
$\begingroup$

Making a community wiki so all of the answers are kept in one singular place.

$n$ Formula Exact Value Error Credit
1 $1$ $1$ $2.14\text{E-}0$ Simd, 2012rcampion
2 $1+2=3$ $3$ $1.42\text{E-}1$ Simd, 2012rcampion
3 $3$ $3$ $1.42\text{E-}1$ Simd, 2012rcampion
4 $3+\frac1{2\times4}=3.125$ $\frac{25}{8}$ $1.66\text{E-}2$ Simd, 2012rcampion
5 $3+\frac1{2+5}$ $\frac{22}{7}$ $1.26\text{E-}3$ 2012rcampion
6 $3+\frac{\frac16+\frac25}4$ $\frac{377}{120}$ $7.4\text{E-}5$ 2012rcampion
7 $3+\frac{\frac16+\frac25}4$ $\frac{377}{120}$ $7.4\text{E-}5$ 2012rcampion
8 $3+\frac{2\times8}{6\times4\times5-7}\approx3.14159292$ $\frac{355}{113}$ $2.67\text{E-}7$ Simd, 2012rcampion
9 $3+\frac{2\times8}{6\times4\times5-7}\approx3.14159292$ $\frac{355}{113}$ $2.67\text{E-}7$ 2012rcampion
10 $3+\frac{1}{7+\frac{10}{4\cdot5\cdot8-\frac{2}{6\cdot9}}}$ $\frac{95828}{30503}$ $2.33\text{E-}8$ Tom Sirgedas
11 $\frac{11}{4}+\frac{2}{5+\frac{6+\frac{1}{9\cdot10-3}}{7\cdot8}} $ $\frac{312689}{99532}$ $2.91\text{E-}11$ Tom Sirgedas
12 $3+\frac{1}{7+\frac{2}{4\cdot8-\frac{11}{9\cdot10(6+12)-5}}} $ $\frac{1146408}{364913}$ $1.61\text{E-}12$ Tom Sirgedas
13 $3+\frac{5}{(6+11)2}-\frac{4}{(\frac{1}{7}+8)9\cdot10-\frac{13}{12}}$ $\frac{6565759}{2089946}$ $2.99\text{E-}13$ Tom Sirgedas
14 $3+\frac{2}{14+\frac{1}{8-\frac{9}{11(4(10\cdot12)+\frac{7}{13+\frac{6}{5}})}}}$ $\frac{133190959}{42395999}$ $5.20\text{e-}15$ Tom Sirgedas
15 $3+\frac{1}{2+15}+\frac{\frac{12}{7+\frac{10}{6\cdot8(14-\frac{9}{13})}}-\frac{4}{5}}{11}$ $\frac{85563208}{27235615}$ $8.60\text{e-}16$ Tom Sirgedas
16
17
18 $\frac{9+16+ (5*10 + (17/4)/(7*14-2/(12-6/(1+3+15)) ))/(13*(18+11))}{8}$ $\frac{411557987}{131002976}$ $1.9\text{e-}17$ Retudin
19
20 $3 + (11 + 6) / 12 / 10 + 18 / ((4 + 15) / 17 / 13 - ((20 * 5 * 16 * 19 - (1 / (2 / 7 - (9 + 14)))) * 8))$ $\frac{644339207239}{205099539720}$ $5.37\text{e-}18$ Dmitry Kamenetsky
$\endgroup$
1
  • $\begingroup$ As any combination of +×÷- with integers can be reduced to a fraction, I am guessing that the 'best' answers will all likely be examples of the continued fraction approximation of pi. $\endgroup$
    – Penguino
    Commented Jan 11 at 0:24
6
$\begingroup$

Even better:
85563208 /27235615 (error 8.6E-16)
80143857/25510582 (error 5.4E-16)

3;7,15,1,292,1,1,1,2,1,3,1,15 = 85563208/(5 * 11 * 17 * 29129) error 8.6e-16
= 16/5+2/11-(4+2442/29129)/17
= 16/5+2/11-(4+(8+3)(1812+6)/(15+1)141013+9)/17
solution for 18

3;7,15,1,292,1,1,1,2,1,3,1,14 = 80143857/(2 * 31 * 479 * 859) error 5.4e-16
= 7/2 - 190 * (28+9/859)/(31 * 479)
= 7/2 - 19 * 10 * (11+17+9/(16x18x3-5)) / (15+16)/(6 * 8 * 10-1)
solution for 19 (14 unused)

= 16/5 + 2/11 +1/17 - 8711/29129
with:
8711 = (3x15x(14+6x(12+18)-19)
29129 = (4x7x8x10x13+9)

Better answer for n=19(+20) and 15(+):

$3 + \frac{9*13*7*(2*6*(19*11+8) +17)}{ 16*(1+12*14*15*(18*5+4))}$
$= 42208400/13435351$
error 1.61E-14

I looked at Bubbler's answer and the list supplied by ThePuzzler- or rather APuzzler to see if continued fractions can be beaten using a single divide of the form 3+a/b.
I tried 15160384 = 16*236881 because of the 16 where 236880 turned out to have a lot of divisors.

$3 + \frac{14*(2*15+11-6)-13}{ 5*9*10*12*(4+1)}$
$=84823/27000$
error 6.1E-8

$\endgroup$
3
  • $\begingroup$ cool. this also improves n=20. $\endgroup$ Commented Jan 6 at 6:22
  • $\begingroup$ @Retudin You can edit my community wiki answer to include your answers if you want $\endgroup$
    – CrSb0001
    Commented Jan 6 at 13:16
  • $\begingroup$ I've updated the wiki with these results $\endgroup$ Commented Jan 7 at 1:01
6
+100
$\begingroup$

Results

Exhaustive Search (n=10)

$3+\frac{1}{7+\frac{10}{4\cdot5\cdot8-\frac{2}{6\cdot9}}} \approx\pi -2.33\text{e-}08$

see 3+1/(7+10/((4*5*8)-2/(6*9))) on WolframAlpha

optimal:                        value          error
3+1/(7+10/((4*5*8)-2/(6*9)))    95828/30503    2.33e-08

((1/((10/((4*(5*8))-(2/(6*9))))+7))+3)   err=2.33567e-08  95828/30503
(4-(6/(7-(1/(9*((2/5)+((3/8)+10)))))))   err=5.96312e-08  85178/27113
((((4/((2*5)+(1/(6*10))))+(7/8))/9)+3)   err=6.22542e-08  135943/43272
((1/((5/(((4+6)*8)-((2/9)/10)))+7))+3)   err=8.13969e-08  79853/25418
(((1-(4/(9*(5*((2/(6*8))+10)))))/7)+3)   err=8.29516e-08  79498/25305
((1/((2/((4*8)-(5/(6*(9*10)))))+7))+3)   err=9.59077e-08  76658/24401

Smart Search (n=11) (nearly exhaustive?)

$\frac{11}{4}+\frac{2}{5+\frac{6+\frac{1}{9\cdot10-3}}{7\cdot8}} \approx\pi +2.91\text{e-}11$

((2/((((6+(1/((9*10)-3)))/8)/7)+5))+(11/4))   err=2.91434e-11  312689/99532
((10/(((9-((2/(7+((5/11)/4)))/6))*8)-1))+3)   err=1.22356e-10  208341/66317
((8/((1/(((4*(5*6))-(3/(10*11)))+9))+7))+2)   err=2.74029e-10  312334/99419
(((1/(2+5))-(6/((8*(9*((10-4)*11)))-7)))+3)   err=3.31628e-10  104348/33215
(((1-((10/(7+(4/(11-(5/8)))))/9))/6)+3)       err=5.77891e-10  103993/33102

Smart Search (n=12) (nearly exhaustive?)

$3+\frac{1}{7+\frac{2}{4\cdot8-\frac{11}{9\cdot10(6+12)-5}}} \approx\pi +1.61\text{e-}12$

((1/((2/((4*8)-(11/((9*(10*(6+12)))-5))))+7))+3)   err=1.61071e-12  1146408/364913
((1/(((5/(8-(2/(9*((11*12)-(6/4))))))/10)+7))+3)   err=8.71525e-12  833719/265381
(6/(((2+4)/((3/(10+(1/(8*(11*12)))))+5))+(7/9)))   err=1.8701e-11   3022542/962105
((((8/((((9+(2/(6+(10*11))))/12)/7)+5))-1)/4)+3)   err=2.91434e-11  312689/99532
((1/((2/((4*8)-(9/((6/5)+(10*(11*12))))))+7))+3)   err=3.14357e-11  521030/165849
((2/((5+10)-((7-(1/(9*((4*(11*12))-6))))/8)))+3)   err=4.80691e-11  1667793/530875
((12/((7/(10-(2/((1/(4*5))+6))))+3))-(8/(9*11)))   err=5.24358e-11  1355104/431343
((1/(((2/(8-(10/(11*((5*(9*12))-6)))))/4)+7))+3)   err=5.94227e-11  1042415/331811
((1/((2/((4*8)-(9/((6+(10*(11*12)))-5))))+7))+3)   err=7.18372e-11  937712/298483
(((5/(7-(11/((4*10)-(3/8)))))-(2/(9+(1/12))))*6)   err=7.23981e-11  729726/232279
((2-((11/((4/(7*9))+12))/10))*((5/3)-(1/(6*8))))   err=8.1021e-11   1146053/364800
((3/(8/9))-(7/((6-(1/(((4*11)-(2/10))*12)))*5)))   err=9.28817e-11  1980837/630520

Smart Search (n=13) (70%?? exhaustive)

$3+\frac{5}{(6+11)2}-\frac{4}{(\frac{1}{7}+8)9\cdot10-\frac{13}{12}} \approx\pi +2.99\text{e-}13$

((((5/(6+11))/2)-(4/((((1/7)+8)*(9*10))-(13/12))))+3)   err=2.9976e-13   6565759/2089946
(((13-(1/(10*((7*12)-(5/11)))))/4)-(8/(2+(6*(3+9)))))   err=4.04121e-13  4272943/1360120
((1/((((((9-2)/(12*((11*13)-6)))/4)+5)/(8*10))+7))+3)   err=6.01741e-13  11672421/3715447
(((2/(((11/5)+12)*((1/10)+13)))+(7/((6*9)-(4/8))))+3)   err=1.14264e-12  3126535/995207
((1/((5/(((13-((11/(9+(8*(10*12))))/4))*6)+2))+7))+3)   err=1.61071e-12  1146408/364913
(4-(6/(7-((11/(12-((3/(5+(8*13)))/2)))/((9*10)-1)))))   err=1.76081e-12  5106662/1625501
((((9/((10+(2/(8-(((7/12)/6)/4))))+(5/11)))+1)/13)+3)   err=2.28573e-12  11047043/3516383
((1/(((((5/(6+(11*((9*(10*12))-13))))+2)/4)/8)+7))+3)   err=2.64322e-12  8337545/2653923
(((1-((4/(5-((12-(13/(11-(2/(8*10)))))/9)))/7))/6)+3)   err=2.73692e-12  1980127/630294
((((((2/((9/8)+((7/(10*13))/5)))+1)/12)+6)/(4*11))+3)   err=3.36842e-12  4898321/1559184
((1/((2/((4*8)-(5/(9+(6*((10*12)+(11/13)))))))+7))+3)   err=3.47278e-12  6774100/2156263
((1/(((((9/(8-(4/((6*(11*13))-12))))+2)/5)/10)+7))+3)   err=3.90532e-12  3751913/1194271
((1/((2/((4*8)-(9/((10*(11*12))+((13-5)/6)))))+7))+3)   err=4.50839e-12  2813846/895675
(7/((2-(1/(5*((3*6)+(10+(11/(12*13)))))))+(4/(8+9))))   err=4.91474e-12  2605505/829358
((8/((1/(11*((7*(12*13))-(2/9))))+3))+((6-(5/4))/10))   err=4.93872e-12  40748593/12970680

note: my code prints the error out as 2.9976e-13 instead of 2.995199e-13 because double-precision math is accurate to only ~16 digits.

Smart Search (n=14) (and k=8)

$3+\frac{2}{14+\frac{1}{8-\frac{9}{11(4(10\cdot12)+\frac{7}{13+\frac{6}{5}})}}}\approx\pi-5.20\text{e-}15$

((2/((1/(8-(9/(11*((4*(10*12))+(7/((6/5)+13)))))))+14))+3)   err=4.88498e-15  133190959/42395999
((((2/(((9-(6/((8+11)*13)))*14)-(1/12)))+(7/5))/10)+3)       err=8.88178e-15  58466453/18610450
(2/((((3/(5*((9*((8*12)-14))-(1/11))))+(7/4))/10)+(6/13)))   err=2.08722e-14  42208400/13435351
((10+((3+13)/(6+((9/(5+14))/8))))/(4+(2/(7*((1/11)+12)))))   err=2.17604e-14  5419351/1725033
((10/3)-(11/(((7+((6+(1/13))/((5/9)+(2*14))))*8)-(4/12))))   err=2.22045e-14  5419351/1725033
((1/(((2/(4-(13/(((11+(9*(10*12)))*14)-5))))/8)+7))+3)       err=2.22045e-14  5419351/1725033
((2/((((7/((4*(6*(10*(5+(11*12)))))+(1/14)))+9)/8)+13))+3)   err=2.22045e-14  163414249/52016371
((((7/((10*(8-(1/11)))+(((13/14)/12)/4)))+6)/((5*9)-2))+3)   err=2.39808e-14  78997449/25145669
((8/(((1/(10-(((3/(4*6))+12)/((11*14)-(5/9)))))/13)+7))+2)   err=3.55271e-14  31369698/9985285
((2/(((((6/(11*(((4*10)-(7/12))*(14-1))))/5)+9)/8)+13))+3)   err=3.81917e-14  120059441/38216107
((2/((1/(8-(10/((6+(9*((4+((7/11)/5))*12)))*13))))+14))+3)   err=4.13003e-14  57320045/18245537
((6/(11*(12+(5/((10*(9+(8*14)))-7)))))+(3+((1/4)-(2/13))))   err=4.79616e-14  25950347/8260252
(((1-((5/((8*(6+(12/(13+(9/(10*(2+14)))))))-4))/11))/7)+3)   err=4.79616e-14  25950347/8260252
(((9-(((5-(1/(10*(12*((4/7)+14)))))/8)/(6+11)))/3)+(2/13))   err=4.88498e-14  203955211/64920960
((1/((6/((8*12)-((9/(10*(11+(2/((13*14)-5)))))/4)))+7))+3)   err=5.50671e-14  55339918/17615243
(4-(5/(6-((14/8)/(10-(2/(3+(11*(12+(1/((7+9)*13)))))))))))   err=6.66134e-14  20530996/6535219
((2/((5/((4*10)-(12/((((6/7)+9)*(11*13))-(1/8)))))+14))+3)   err=7.41629e-14  140069407/44585477
((2/((9/(8-(1/(12*((4*(10*11))+(7/(5+14)))))))+13))+3)       err=7.99361e-14  35642641/11345405
((1/((5/((8*10)-((9/((12-2)*(6+14)))-(4/(11*13)))))+7))+3)   err=8.52651e-14  50754286/16155591
((10/(((1-((6/((8*12)+(4/(9*13))))/5))/14)+7))+(2-(3/11)))   err=9.14824e-14  96089221/30586149  
((((2/((1/(10*(12-(11/((6*(13*14))-4)))))+5))+(7/8))/9)+3)   err=9.63674e-14  73890787/23520168
((1/(8-(((2/11)+12)/(13-(4/((5/7)+(10*((6*9)+14))))))))+3)   err=9.81437e-14  15111645/4810186

note: more rounding errors, and now duplicated fractions

(n=15)

$3+\frac{1}{2+15}+\frac{\frac{12}{7+\frac{10}{6\cdot8(14-\frac{9}{13})}}-\frac{4}{5}}{11}\approx\pi+8.60\text{e-}16$

3+((((12/(7+(((10/(14-(9/13)))/8)/6)))-(4/5))/11)+(1/(2+15))) = 85563208/27235615

3+(2/((9/(8-((7/(((5+10)*(14*15))-(11/6)))/(12-(1/4)))))+13))   err=  9.6984e-16  14204192/100317295  

How

Exhaustive search
Let $F(S)$ be the set of numbers you can "achieve" using the numbers in set $S$.

For example,
$F(\{3\}) = \{3\}$
$F(\{3,4\}) = \{3,4,7,-1,1,12,\frac{3}{4},\frac{4}{3}\}$

Then the problem is to find the element in $F(\{1,2,3,...,n\})$ nearest $\pi$.

How can you calculate $F(S)$? Let's consider this element of $F(\{1,2,3,4\})$: $$ \frac{1}{3}+4\cdot2 $$ The outer-most operation is addition. So it's an element of $F(\{1,3\})$ $+$ an element of $F(\{2,4\})$. Generalizing this gives you a way to compute $F(\{1,2,...,n\})$. Note that this involves computing $F$ for $2^{n}-1$ subsets.

Smart search

Consider the element in $F(\{1,2,...,10\})$ nearest $\pi$, (where $\epsilon$ is about $-2.33e-08$): $$ \pi +\epsilon =3+\frac{1}{7+\frac{10}{4\cdot5\cdot8-\frac{2}{6\cdot9}}} $$ Let's move some of the numbers to the left side of the equation: $$ \frac{10}{\frac{1}{(\pi +\epsilon)-3}-7} =4\cdot5\cdot8-\frac{2}{6\cdot9} $$ Hmm, so this version could have been discovered by calculating $F(\{\pi,1,3,7,10\})$ and $F(\{2,4,5,6,8,9\})$ and considering pairs of elements that are nearly equal (and then solving for $\epsilon$).

Better yet, for each element of $F(\{\pi,1,3,7,10\})$, replace $\pi$ with $\pi+0.00001$ and then $\pi-0.00001$ to get a range of values. For example, $$ \frac{10}{\frac{1}{(\pi \pm 0.00001)-3}-7} $$ gives the range $[158.699,161.252]$ and $4\cdot5\cdot8-\frac{2}{6\cdot9}$ is within this range. So, solving for $\pi$ guarantees an error less than $0.00001$.

Generalizing this observation gives the "Smart Search". Split $\{\pi,1,2,...,n\}$ into two pieces, where the side without $\pi$ has exactly $k$ elements (it's best for $k$ to be near $n/2$). In the example above $k$ was $6$. Notice that $k=7$ would uncover the same result, but $k=5$ would miss it, because $4\cdot5\cdot8$ and $\frac{2}{6\cdot9}$ use three numbers each.

Anyways, this technique allows my computer to search up to $n=14$ with $k=8$, instead of the exhaustive search which uses too much RAM at $n=11$ (and is much slower).

$\endgroup$
3
  • 1
    $\begingroup$ Great work Tom! I knew you would enjoy this puzzle! $\endgroup$ Commented Jan 14 at 10:49
  • 3
    $\begingroup$ Thanks! Yeah, thanks for sharing, it's very interesting. $\endgroup$ Commented Jan 14 at 17:58
  • 1
    $\begingroup$ Nice results. I found your n=11 err, but for n=12. Also found your n=12 err, but for n=13. Possibly they are optimal. Please update the community wiki once you are done. $\endgroup$ Commented Jan 16 at 14:40
6
$\begingroup$

I found some new records using Simulated Annealing. My constructions use general expressions formed by binary expression trees.

$n=11$

error 2.74E-10
$3 + 1 / (7 + 5 / (8 * 10 - 9 / 11 / 2 / 4 / 6)) = 3.1415926533157648$

$n=12$

error 2.91E-11 $3 + 2 / (7 + 6 + 9 / (8 - 1 / (5 + 4 * 10 * 11 * 12))) = 3.1415926536189365$

$n=13$

error 1.61E-12 $3 + 1 / (7 + 5 / (2 + 6*13 + 11 / (8 + 9) / (10 - 4 * 12))) = 3.141592653591404$

$n=14$

error 3.82E-14 $ 3 + 2 / (14 + (1 - 6 / 5 / 11 / (7 / 12 - 10 * 4) / 13) / 8) = 3.141592653589755 $

$n=18$

error 4.1E-16 $726714064/231320271 = 3 + 2 / 14 - 10 / (15 * ((4 / (18 + (1 / (9 + (7 * (11 + (6 / 13))))))) - (5 - 16 - 12 - 8) * 17))))$

$n=20$

error 5.37E-18.
$644339207239/205099539720 = 3 + (11 + 6) / 12 / 10 + 18 / ((4 + 15) / 17 / 13 - ((20 * 5 * 16 * 19 - (1 / (2 / 7 - (9 + 14)))) * 8))$

Old results

$n=13$, error 1.45E-9.
$3 + (((9 / 11 / 13 / 12 - 5) / 6 - 2) / 8 / 4 / 10 + 1) / 7 = 3.141592652139527$.
$n=14$, error 1.56E-10.
$5-2 + (((7 / 13 / 3 + 10) / 12 / 8 + 14 + 4) / 6 / 11 + 1) / 9 = 3.1415926537454313$. $n=16$, error 4.95E-12.
$3 + ((((7 / 11 / 4 + 6) / 13 / 9 - 10) / 5 / 14 / 16 + 2) / 15 + 1) / 8 = 3.141592653584841$. $n=17$, error 8.68E-13.
$3 + (((((5 / 9 / 6 - 11) / 17 + 15) / 4 + 13) / 12 / 8 / 10 - 2) / 16 / 14 + 1) / 7$. $ = 3.141592653590661$

$\endgroup$
4
  • $\begingroup$ How did you find them? $\endgroup$
    – Simd
    Commented Jan 7 at 12:25
  • 1
    $\begingroup$ Added a brief explanation. $\endgroup$ Commented Jan 7 at 12:29
  • $\begingroup$ What do you get for 12? $\endgroup$
    – Simd
    Commented Jan 7 at 12:32
  • 1
    $\begingroup$ I improved 12 now :) $\endgroup$ Commented Jan 14 at 13:44
4
$\begingroup$

$n=10$:

Attempt 1.1: Expansion of arctan(1) [3 terms]

Yeah, this might not be a great idea. We know that

$$4\arctan1=\pi=4\sum_{n\ge0}\dfrac{(-1)^n}{2n+1}$$

So we can approximate this with three terms to get

$$4\arctan1\approx4\left(1-\dfrac13+\dfrac15\right)\\=4\times\dfrac{13}{15}=4\times\dfrac{7+6}{3\times5}$$which is not accurate at all. ($=3.4\overline6$)

Attempt 1.2: Expansion of arctan(1) [4 terms]

We can now try this with 4 terms with

$$4\arctan1\approx4\left(1-\dfrac13+\dfrac15-\dfrac17\right)\\=4\times\dfrac{76}{105}=4\times\dfrac{6(10+1+2)}{3\times5\times7}$$which is also not accurate.

Attempt 1.3: Expansion of arctan(1) [5 terms]

Using 5 terms, we can try to get to 315 in our denominator and 263 in our numerator. The only problem is I am unsure how to. Here is my attempt (since we need the 4 to multiply our expansion):

$$263:\text{ }2^8+7\text{ (numbers left: }1,3,5,6,9,10)\\315:\text{ (unable to do, closest was }316)\text{ }3^5+7\times9+10=316$$and now we do$$4\times\dfrac{263}{316}\approx3.3291$$which is actually more accurate than if I had managed to get 315[1], and we can get this more accurate with using up 6 and 1, which I managed to not use to get$$4\times\dfrac{263}{323}=4\times\dfrac{2^8+7}{3^5+7\times9+10+1+6}\approx3.25696594$$which is even more accurate than before (and in my testing with expansions, is the most accurate I managed to get it) but still not close enough to even be considered probably. I'll come back to this in the future.

Attempt 2: Unoriginality (original method by 2012rcampion)

Yeah, we're using $\dfrac{355}{113}$ again. However, this time, we can use all of the numbers:

$$\dfrac{355}{113}=\left(3+\dfrac{2\times8}{6\times4\times5-7}\right)(10-9)\approx3.141592920\dots$$which yet again has an error of $2.67E-7$.

However, I will try to provide a fully original solution for $n=10$ in the future.


[1]As I finish up writing this post, I just realized I'm stupid. I could have just subtracted 1 from 10 to get $7\times9+10-1=7\times9+9=9(7+1)=8\times9$ which would have been all that I would have needed to do to get the $315$ I wanted. But hey, I've already found a better solution for my expansion of $4\arctan1$ already, so it doesn't matter.


Edit 1: I have a solution for $n=17$:

$n=17$:

Attempt 1: Small digit approximation method.

We get this from using the small digit approximation for $\pi$: [source]

$$.1^{-2/3}+(4/.5)^{-6}-.7-.8$$

So what do we do?

First off, we can rewrite this as$$(1/10)^{-2/3}+8^{-6}-(7/10)-(8/10)$$Now, rewrite $-2/3$ as $(4-6)/3$ and $7/10$ as $7/(12-2)$ so now it is$$\left(\dfrac1{10}\right)^{(4-6)/3}+8^{-6}-\dfrac7{12-2}-\dfrac8{10}$$Now, to get our -6, we replace that with 5-11 (which is the only replacement that I found that I was able to make that would not require me to restart this) and finally, we use $\dfrac{17-13}{14-9}=\dfrac45$ to rewrite our approximation for $n=17$ as (without using 16 or 15)$$\left(\dfrac1{10}\right)^{(4-6)/3}+8^{5-11}-\dfrac7{12-2}-\dfrac{17-13}{14-9}$$which now the approximation is improved to just be $5.28E-9$ less than $\pi$, my most accurate solution so far.


Edit 2: $n=11$ and $n=13$ solution

$n=11$

Attempt 1: Continued fraction for $\pi$

This is a method using the continued fraction expression of $\pi$. The first few terms for this are

$$3+\dfrac1{7+\dfrac1{16}}$$

which we can rewrite as

$$3+\dfrac1{7+\dfrac{5-4}{6+9+11-10}}=\dfrac{355}{113}$$


$n=13$

Attempt 1: Continued fraction

This uses the same method as $n=11$, but this time we can write it as

$$3+\dfrac1{7+\dfrac{5-4}{6+9+\dfrac{11-10}{13-12}}}=\dfrac{355}{113}$$

$\endgroup$
1
  • 1
    $\begingroup$ But we are not allowed to use powers, so your n=17 is not valid. $\endgroup$ Commented Jan 7 at 1:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.