Post Reply 
Pi Approximation Day
07-24-2022, 11:30 AM (This post was last modified: 07-24-2022 11:32 AM by Thomas Klemm.)
Post: #21
RE: Pi Approximation Day
(07-22-2022 11:47 PM)Gerson W. Barbosa Wrote:  \(
\begin{align}
e^{\sqrt[11_{3}]{\frac{2222_{4}-\frac{1}{22_{9}^{2}+22_{16}^{2}+\frac{1}{1111_{7}}}}{99_{10}}}}
\end{align}
\)

I tried to convert \(2222_{4}\) in my head:

\(
\begin{align}
2222_{4}
&= 2 \cdot 1111_{4} \\
&= 2 \cdot (4^3 + 4^2 + 4 + 1) \\
&= 2 \cdot \frac{4^4 - 1}{4 - 1} \\
&= 2 \cdot \frac{17 \cdot 15}{3} \\
&= 170 \\
\end{align}
\)

And similarly \(1111_{7}\):

\(
\begin{align}
1111_{7}
&= 7^3 + 7^2 + 7 + 1 \\
&= \frac{7^4 - 1}{7 - 1} \\
&= \frac{50 \cdot 48}{6} \\
&= 400 \\
\end{align}
\)

The other numbers were easy, so I ended up with:

3.141592653589793212117310511154447
-----------------------------------
3.141592653589793238462643383279503

You never cease to amaze me with your approximations of \(\pi\).


Today I learned how to enter the base of a number in the Wolfram language:

E^Surd[(4^^2222 - 1/(9^^22^2 + 16^^22^2 + 1/7^^1111))/99, 3^^11]
Find all posts by this user
Quote this message in a reply
07-24-2022, 11:59 AM
Post: #22
RE: Pi Approximation Day
(07-23-2022 05:18 PM)C.Ret Wrote:  \( \sqrt{10-\frac{1}{\left ( 10^2+10 \right )^3}-\frac{1}{\left ( 9^2+9 \right )^3}-\frac{1}{\left ( 8^2+8 \right )^3}-\cdots -\frac{1}{\left ( 2^2+2 \right )^3}-\frac{1}{\left ( 1^2+1 \right )^3}} = \sqrt{ \frac{2\,780\,722\,699}{281\,746\,080} } \approx \pi \)

Interesting.
Using that equation with a summation of 1-10 approximates Pi to 7 digits.
Using it with a summation of 1-87 approximates Pi to 12 digits.

   
Visit this user's website Find all posts by this user
Quote this message in a reply
07-24-2022, 01:28 PM
Post: #23
RE: Pi Approximation Day
(07-24-2022 11:30 AM)Thomas Klemm Wrote:  Today I learned how to enter the base of a number in the Wolfram language:
I tested it in Maple and was amaized of accuracy of this approximation too Smile
Code:

> Digits:=32:
> exp(((convert(2222, decimal, 4)-(1/(convert(22, decimal, 9)^2+convert(22, decimal, 16)^2+1/convert(1111, decimal, 7))))/99) ^ (1.0/convert(11, decimal, 3)));
                                           3.1415926535897932121173105111546
> evalf(Pi);
                                           3.1415926535897932384626433832795
>
Find all posts by this user
Quote this message in a reply
07-24-2022, 03:52 PM
Post: #24
RE: Pi Approximation Day
(07-24-2022 11:59 AM)Steve Simpkin Wrote:  Using that equation with a summation of 1-10 approximates Pi to 7 digits.
Using it with a summation of 1-87 approximates Pi to 12 digits.

Looking at the table in this previous post we can see that we gain about 5 digits if n is multiplied by 10.
Which is really bad.

Compare it with this program to calculate the Taylor series of the \(\arctan(x)\) function:

\(
\begin{align}
\arctan(x)=x-\frac{x^{3}}{3}+\frac{x^{5}}{5}-\frac{x^{7}}{7}+\cdots =\sum _{n=0}^{\infty}\frac {(-1)^{n}x^{2n+1}}{2n+1}
\end{align}
\)

And then use:

\(
\begin{align}
\frac{\pi}{4}=\arctan \frac{1}{2} + \arctan \frac{1}{3}
\end{align}
\)

Code:
00 { 23-Byte Prgm }
01 STO 00
02 R↓
03 ENTER
04 ENTER
05 ENTER
06 CLX
07▸LBL 00
08 ×
09 RCL 00
10 2
11 ×
12 1
13 -
14 1/X
15 X<>Y
16 -
17 ×
18 DSE 00
19 GTO 00
20 END

Example

Make sure we're at the beginning of the program:

RTN

Calculate \(\arctan \frac{1}{2}\):

2
1/X
53
R/S
STO 01

4.636476090008061162142562314612144e-1

Calculate \(\arctan \frac{1}{3}\):

3
1/X
33
R/S

3.217505543966421934014046143586614e-1

Calculate \(\pi=4\left(\arctan \frac{1}{2} + \arctan \frac{1}{3}\right)\):

RCL 01
+
4
×

3.141592653589793238462643383279503

Which is correct to all places.

(07-23-2022 11:31 PM)Valentin Albillo Wrote:  it converges very fast (order 6), the general term is extremely simple to program needing just 6 steps, and this makes for speedy looping and very short running times

The code in the loop of this program isn't much more complicated but instead of using 1000000 terms to get 33 correct digits we only need 53 + 33 = 86 terms to get 34 correct digits of \(\pi\).

And there are ways to even reduce this further e.g. by using Machin's formula:

\(
\begin{align}
\frac{\pi}{4}=4 \arctan \frac{1}{5} - \arctan \frac{1}{239}
\end{align}
\)

References
Find all posts by this user
Quote this message in a reply
07-24-2022, 06:39 PM (This post was last modified: 07-24-2022 07:25 PM by pauln.)
Post: #25
RE: Pi Approximation Day
In particular, in Python it is trivial to compute \(\pi\) (with no library, just integer arithmetic) and other constants with any number of decimals. For example this program computes 10,000 digits of \(\pi\) (The first 9,995 digits being correct). Takes 0.3 seconds on my laptop.

Code:

# Computes the arctan of 1/n, where n is an integer.
def arctan(n, num_terms, num_digits):
    # x = 1/n.
    x_to_i = 10**num_digits // n
    result = x_to_i
    for i in range(1, num_terms):
        x_to_i //= -n*n
        result += x_to_i // (i * 2 + 1)
    return result

def pi(num_digits):
    num_terms = 4 * num_digits
    return 4*(arctan(2, num_terms, num_digits) + arctan(3, num_terms, num_digits))

print('10000 digits of pi:\n' + str(pi(10000)))

Result:

Code:
10000 digits of pi:
31415926535897932384626433832795028841971693993751058209749445923078164062862089​98628034825342117067982148086513282306647093844609550582231725359408128481117450​28410270193852110555964462294895493038196442881097566593344612847564823378678316​52712019091456485669234603486104543266482133936072602491412737245870066063155881​74881520920962829254091715364367892590360011330530548820466521384146951941511609​43305727036575959195309218611738193261179310511854807446237996274956735188575272​48912279381830119491298336733624406566430860213949463952247371907021798609437027​70539217176293176752384674818467669405132000568127145263560827785771342757789609​17363717872146844090122495343014654958537105079227968925892354201995611212902196​08640344181598136297747713099605187072113499999983729780499510597317328160963185​95024459455346908302642522308253344685035261931188171010003137838752886587533208​38142061717766914730359825349042875546873115956286388235378759375195778185778053​21712268066130019278766111959092164201989380952572010654858632788659361533818279​68230301952035301852968995773622599413891249721775283479131515574857242454150695​95082953311686172785588907509838175463746493931925506040092770167113900984882401​28583616035637076601047101819429555961989467678374494482553797747268471040475346​46208046684259069491293313677028989152104752162056966024058038150193511253382430​03558764024749647326391419927260426992279678235478163600934172164121992458631503​02861829745557067498385054945885869269956909272107975093029553211653449872027559​60236480665499119881834797753566369807426542527862551818417574672890977772793800​08164706001614524919217321721477235014144197356854816136115735255213347574184946​84385233239073941433345477624168625189835694855620992192221842725502542568876717​90494601653466804988627232791786085784383827967976681454100953883786360950680064​22512520511739298489608412848862694560424196528502221066118630674427862203919494​50471237137869609563643719172874677646575739624138908658326459958133904780275900​99465764078951269468398352595709825822620522489407726719478268482601476990902640​13639443745530506820349625245174939965143142980919065925093722169646151570985838​74105978859597729754989301617539284681382686838689427741559918559252459539594310​49972524680845987273644695848653836736222626099124608051243884390451244136549762​78079771569143599770012961608944169486855584840635342207222582848864815845602850​60168427394522674676788952521385225499546667278239864565961163548862305774564980​35593634568174324112515076069479451096596094025228879710893145669136867228748940​56010150330861792868092087476091782493858900971490967598526136554978189312978482​16829989487226588048575640142704775551323796414515237462343645428584447952658678​21051141354735739523113427166102135969536231442952484937187110145765403590279934​40374200731057853906219838744780847848968332144571386875194350643021845319104848​10053706146806749192781911979399520614196634287544406437451237181921799983910159​19561814675142691239748940907186494231961567945208095146550225231603881930142093​76213785595663893778708303906979207734672218256259966150142150306803844773454920​26054146659252014974428507325186660021324340881907104863317346496514539057962685​61005508106658796998163574736384052571459102897064140110971206280439039759515677​15770042033786993600723055876317635942187312514712053292819182618612586732157919​84148488291644706095752706957220917567116722910981690915280173506712748583222871​83520935396572512108357915136988209144421006751033467110314126711136990865851639​83150197016515116851714376576183515565088490998985998238734552833163550764791853​58932261854896321329330898570642046752590709154814165498594616371802709819943099​24488957571282890592323326097299712084433573265489382391193259746366730583604142​81388303203824903758985243744170291327656180937734440307074692112019130203303801​97621101100449293215160842444859637669838952286847831235526582131449576857262433​44189303968642624341077322697802807318915441101044682325271620105265227211166039​66655730925471105578537634668206531098965269186205647693125705863566201855810072​93606598764861179104533488503461136576867532494416680396265797877185560845529654​12665408530614344431858676975145661406800700237877659134401712749470420562230538​99456131407112700040785473326993908145466464588079727082668306343285878569830523​58089330657574067954571637752542021149557615814002501262285941302164715509792592​30990796547376125517656751357517829666454779174501129961489030463994713296210734​04375189573596145890193897131117904297828564750320319869151402870808599048010941​21472213179476477726224142548545403321571853061422881375850430633217518297986622​37172159160771669254748738986654949450114654062843366393790039769265672146385306​73609657120918076383271664162748888007869256029022847210403172118608204190004229​66171196377921337575114959501566049631862947265473642523081770367515906735023507​28354056704038674351362222477158915049530984448933309634087807693259939780541934​14473774418426312986080998886874132604721569516239658645730216315981931951673538​12974167729478672422924654366800980676928238280689964004824354037014163149658979​40924323789690706977942236250822168895738379862300159377647165122893578601588161​75578297352334460428151262720373431465319777741603199066554187639792933441952154​13418994854447345673831624993419131814809277771038638773431772075456545322077709​21201905166096280490926360197598828161332316663652861932668633606273567630354477​62803504507772355471058595487027908143562401451718062464362679456127531813407833​03362542327839449753824372058353114771199260638133467768796959703098339130771098​70408591337464144282277263465947047458784778720192771528073176790770715721344473​06057007334924369311383504931631284042512192565179806941135280131470130478164378​85185290928545201165839341965621349143415956258658655705526904965209858033850722​42648293972858478316305777756068887644624824685792603953527734803048029005876075​82510474709164396136267604492562742042083208566119062545433721315359584506877246​02901618766795240616342522577195429162991930645537799140373404328752628889639958​79475729174642635745525407909145135711136941091193932519107602082520261879853188​77058429725916778131496990090192116971737278476847268608490033770242429165130050​05168323364350389517029893922334517220138128069650117844087451960121228599371623​13017114448464090389064495444006198690754851602632750529834918740786680881833851​02283345085048608250393021332197155184306354550076682829493041377655279397517546​13953984683393638304746119966538581538420568533862186725233402830871123282789212​50771262946322956398989893582116745627010218356462201349671518819097303811980049​73407239610368540664319395097901906996395524530054505806855019567302292191393391​85680344903982059551002263535361920419947455385938102343955449597783779023742161​72711172364343543947822181852862408514006660443325888569867054315470696574745855​03323233421073015459405165537906866273337995851156257843229882737231989875714159​57811196358330059408730681216028764962867446047746491599505497374256269010490377​81986835938146574126804925648798556145372347867330390468838343634655379498641927​05638729317487233208376011230299113679386270894387993620162951541337142489283072​20126901475466847653576164773794675200490757155527819653621323926406160136358155​90742202020318727760527721900556148425551879253034351398442532234157623361064250​63904975008656271095359194658975141310348227693062474353632569160781547818115284​36679570611086153315044521274739245449454236828860613408414863776700961207151249​14043027253860764823634143346235189757664521641376796903149501910857598442391986​29164219399490723623464684411739403265918404437805133389452574239950829659122850​85558215725031071257012668302402929525220118726767562204154205161841634847565169​99811614101002996078386909291603028840026910414079288621507842451670908700069928​21206604183718065355672525325675328612910424877618258297651579598470356222629348​60034158722980534989650226291748788202734209222245339856264766914905562842503912​75771028402799806636582548892648802545661017296702664076559042909945681506526530​53718294127033693137851786090407086671149655834343476933857817113864558736781230​14587687126603489139095620099393610310291616152881384379099042317473363948045759​31493140529763475748119356709110137751721008031559024853090669203767192203322909​43346768514221447737939375170344366199104033751117354719185504644902636551281622​88244625759163330391072253837421821408835086573917715096828874782656995995744906​61758344137522397096834080053559849175417381883999446974867626551658276584835884​53142775687900290951702835297163445621296404352311760066510124120065975585127617​85838292041974844236080071930457618932349229279650198751872127267507981255470958​90455635792122103334669749923563025494780249011419521238281530911407907386025152​27429958180724716259166854513331239480494707911915326734302824418604142636395480​00448002670496248201792896476697583183271314251702969234889627668440323260927524​96035799646925650493681836090032380929345958897069536534940603402166544375589004​56328822505452556405644824651518754711962184439658253375438856909411303150952617​93780029741207665147939425902989695946995565761218656196733786236256125216320862​86922210327488921865436480229678070576561514463204692790682120738837781423356282​36089632080682224680122482611771858963814091839036736722208883215137556003727983​94004152970028783076670944474560134556417254370906979396122571429894671543578468​78861444581231459357198492252847160504922124247014121478057345510500801908699603​30276347870810817545011930714122339086639383395294257869050764310063835198343893​41596131854347546495569781038293097164651438407007073604112373599843452251610507​02705623526601276484830840761183013052793205427462865403603674532865105706587488​22569815793678976697422057505968344086973502014102067235850200724522563265134105​59240190274216248439140359989535394590944070469120914093870012645600162374288021​09276457931065792295524988727584610126483699989225695968815920560010165525632148​0
Find all posts by this user
Quote this message in a reply
07-24-2022, 07:13 PM
Post: #26
RE: Pi Approximation Day
(07-24-2022 03:52 PM)Thomas Klemm Wrote:  Calculate \(\arctan \frac{1}{3}\):

3
1/X
33
R/S

3.217505543966421934014046143586614e-1

atan(1/3) ≈ 18.4° ≈ pi/10

We might as well get exactly pi/10, by adjusting atan argument.
[Image: images?q=tbn:ANd9GcSuOO5t4LJSn9uhQTWNIQz...p;usqp=CAU]

pi/10 = 18° = sin(1/(2ϕ))
tan(pi/10) = 1/√((2ϕ)²-1) = 1/√(4ϕ+3) = 1/√(5+√20))


20 SQRT 5 + SQRT 1/X      // 3.249196962329063261558714122151344e-1
33
R/S

3.141592653589793238462643383279503e-1
Find all posts by this user
Quote this message in a reply
07-24-2022, 09:10 PM
Post: #27
RE: Pi Approximation Day
That's rather a good idea Albert!

About these various offerings for more efficient calculation of pi - I feel they miss the point a little bit. I think - for me - the appeal of Valentin's offering comes from the rather small number of terms to get the recognisable first few digits, and the clever hiding of the 10 as a loop counter.

I've run this formula of Ramanujan on various systems with various kinds of floats... the long double precision on Raspberry Pi 4 takes some 275000 terms to converge, giving about 30 digits of pi.
Find all posts by this user
Quote this message in a reply
07-24-2022, 10:16 PM
Post: #28
RE: Pi Approximation Day
(07-24-2022 07:13 PM)Albert Chan Wrote:  We might as well get exactly pi/10, by adjusting atan argument.

Or then use:

\(
\begin{align}
\tan \frac{\pi}{12} = 2 - \sqrt{3}
\end{align}
\)

Example

2 ENTER 3 SQRT -
28
R/S
12
×

3.141592653589793238462643383279506
Find all posts by this user
Quote this message in a reply
07-24-2022, 11:27 PM
Post: #29
RE: Pi Approximation Day
(07-24-2022 09:10 PM)EdS2 Wrote:  [...] I think - for me - the appeal of Valentin's offering comes from the rather small number of terms to get the recognisable first few digits, and the clever hiding of the 10 as a loop counter. [...]

I will add that the solution has a nice "binary" feeling. The only digits used are 0's and 1's: "10", "LBL 00", "1/X" and "GTO 00".

And the sequence with the different variants of RCL, lines 5 through 9, is also quite pleasing.
Find all posts by this user
Quote this message in a reply
07-25-2022, 12:03 AM
Post: #30
RE: Pi Approximation Day
(07-24-2022 10:16 PM)Thomas Klemm Wrote:  \(
\begin{align}
\tan \frac{\pi}{12} = 2 - \sqrt{3}
\end{align}
\)

Assumed x in first quadrant, to avoid cancellation errors, we can use cotangent

cot(x/2) = cot(x) + √(1 + cot(x)^2)

cot(pi/6) = √3      → cot(pi/12) = √3 + √(1+3) = 2 + √3

3 SQRT 2 +               // cot(pi/12) ≈ 3.732
ENTER X^2 1 + SQRT +     // cot(pi/24) ≈ 7.596
ENTER X^2 1 + SQRT +     // cot(pi/48) ≈ 15.26
ENTER X^2 1 + SQRT +     // cot(pi/96) ≈ 30.55
1/X
11
R/S
96 *

3.141592653589793238462643383279503
Find all posts by this user
Quote this message in a reply
07-25-2022, 12:26 AM
Post: #31
RE: Pi Approximation Day
.
Hi, EdS2,

(07-24-2022 09:10 PM)EdS2 Wrote:  About these various offerings for more efficient calculation of pi - I feel they miss the point a little bit. I think - for me - the appeal of Valentin's offering comes from the rather small number of terms to get the recognisable first few digits, and the clever hiding of the 10 as a loop counter.

Thanks for your appreciation, and that also applies to pauln's aesthetic appreciation as well.

I also think Mr. Klemm et al. really did miss the point, turning this Pi Approximation Day thread into yet another Pi Day thread.

Getting Pi to 1,000 or 10,000 or whatever high number of places isn't proper for an approximation (like 22/7), which surely should never exceed the 10-12 digits available in our vintage HP calculators (as my 14-step code did), and has been done and redone and re-redone to death countless times in this forum and others.

Also, getting said 1,000 digits on a laptop or using Matlab or something similar utterly detracts from the purpose here.

This is the Museum of HP calculators, after all. There are plenty of places where you can show off your proficiency with Matlab or Mathematica or Python in your laptop if for the umpteen time you can't resist the urge to show off your abilities using such.

Best regards.
V out.

  
All My Articles & other Materials here:  Valentin Albillo's HP Collection
 
Visit this user's website Find all posts by this user
Quote this message in a reply
07-25-2022, 06:38 AM
Post: #32
RE: Pi Approximation Day
(07-25-2022 12:03 AM)Albert Chan Wrote:  3 SQRT 2 +               // cot(pi/12) ≈ 3.732
ENTER X^2 1 + SQRT +     // cot(pi/24) ≈ 7.596
ENTER X^2 1 + SQRT +     // cot(pi/48) ≈ 15.26
ENTER X^2 1 + SQRT +     // cot(pi/96) ≈ 30.55
1/X

Now we're close enough to 0 that using only the first two terms of the Taylor series of the \(\arctan(x)\) function gives a good approximation for \(\pi\):

\(
\begin{align}
\arctan(x)\approx x-\frac{x^{3}}{3}
\end{align}
\)

So we can continue with:

ENTER ENTER X↑2 ×
3 ÷ -
96 ×

3.14159193225



Instead of:

ENTER X^2 1 + SQRT +

we could also use:

1 X<>Y →POL LASTX +
Find all posts by this user
Quote this message in a reply
07-25-2022, 09:28 PM (This post was last modified: 07-26-2022 01:47 PM by Thomas Klemm.)
Post: #33
RE: Pi Approximation Day
(07-23-2022 02:20 AM)Thomas Klemm Wrote:  It uses Ramanujan's formula:

\(
\begin{align}
\pi^2 = 10 - \sum_{n=1}^{\infty} \frac{1}{n^3(n+1)^3}
\end{align}
\)

As I wondered why this should be the case I came up with the following derivation:

\(
\begin{align}
\frac{1}{n} - \frac{1}{n+1}
&= \frac{n+1 - n}{n(n+1)} \\
&= \frac{1}{n(n+1)} \\
\end{align}
\)

Plug this into the infinite sum to get:

\(
\begin{align}
\sum_{n=1}^{\infty} \frac{1}{n^3(n+1)^3}
&= \sum_{n=1}^{\infty} \frac{1}{[n(n+1)]^3} \\
&= \sum_{n=1}^{\infty} \left[\frac{1}{n} - \frac{1}{n+1}\right]^3 \\
\end{align}
\)

That's a bit like a telescoping sum.
It is of the form:

\(
\begin{align}
[a-b]^3 + [b-c]^3 + [c-d]^3 + \cdots
&= a^3 - 3a^2b + 3ab^2 - b^3 \\
&+ b^3 - 3b^2c + 3bc^2 - c^3 \\
&+ c^3 - 3c^2d + 3cd^2 - d^3 \\
&+ \cdots
\end{align}
\)

We notice that \(b^3\), \(c^3\), \(d^3\), \(\cdots\) all cancel.
Also we can extract the common factors of the residual terms:

\(
\begin{align}
[a-b]^3 + [b-c]^3 + [c-d]^3 + \cdots
= a^3 &- 3ab(a-b) \\
&- 3bc(b-c) \\
&- 3cd(c-d) \\
&+ \cdots
\end{align}
\)

This leaves us with:

\(
\begin{align}
\sum_{n=1}^{\infty} \frac{1}{n^3(n+1)^3}
&= 1 - 3 \sum_{n=1}^{\infty} \frac{1}{n} \frac{1}{n+1} \left[\frac{1}{n} - \frac{1}{n+1}\right] \\
&= 1 - 3 \sum_{n=1}^{\infty} \frac{1}{n} \frac{1}{n+1}\frac{1}{n(n+1)} \\
&= 1 - 3 \sum_{n=1}^{\infty} \frac{1}{[n(n+1)]^2} \\
\end{align}
\)

A quick sanity check shows: Sum[1/(n(n+1))^2,{n,1,∞}]

\(
\begin{align}
\sum_{n=1}^{\infty} \frac{1}{[n(n+1)]^2} = \frac{1}{3}\left(\pi^2-9\right)
\end{align}
\)

It appears that we're on track.

We can do the same as before but now the squares don't cancel:

\(
\begin{align}
[a-b]^2 + [b-c]^2 + [c-d]^2 + \cdots
&= a^2 - 2ab + b^2 \\
&+ b^2 - 2bc + c^2 \\
&+ c^2 - 2cd + d^2 \\
&+ \cdots
\end{align}
\)

Instead they are added twice (except for the first) and so we get:

\(
\begin{align}
\sum_{n=1}^{\infty} \frac{1}{[n(n+1)]^2}
&= 2 \sum_{n=1}^{\infty} \frac{1}{n^2} - 1 \\
&- 2 \sum_{n=1}^{\infty} \frac{1}{n(n+1)} \\
\end{align}
\)

But the second sum is a telescoping sum:

\(
\begin{align}
\sum_{n=1}^{\infty} \frac{1}{n(n+1)}
&= \sum_{n=1}^{\infty} \frac{1}{n} - \frac{1}{n+1} \\
&= 1
\end{align}
\)

And thus we end up with:

\(
\begin{align}
\sum_{n=1}^{\infty} \frac{1}{[n(n+1)]^2}
&= 2 \sum_{n=1}^{\infty} \frac{1}{n^2} - 3 \\
\end{align}
\)

But now we're in well known territory since:

\(
\begin{align}
\sum_{n=1}^{\infty} \frac{1}{n^2} = \frac{\pi^2}{6} \\
\end{align}
\)

This leads to:

\(
\begin{align}
\sum_{n=1}^{\infty} \frac{1}{[n(n+1)]^2}
&= 2 \frac{\pi^2}{6} - 3 \\
&= \frac{\pi^2}{3} - 3 \\
&= \frac{1}{3}\left(\pi^2-9\right) \\
\end{align}
\)

Plug this into the formula above and we get:

\(
\begin{align}
\sum_{n=1}^{\infty} \frac{1}{n^3(n+1)^3}
&= 1 - 3 \sum_{n=1}^{\infty} \frac{1}{[n(n+1)]^2} \\
&= 1 - 3 \frac{1}{3}\left(\pi^2-9\right) \\
&= 1 - \pi^2 + 9 \\
&= 10 - \pi^2 \\
\end{align}
\)

References
Find all posts by this user
Quote this message in a reply
07-26-2022, 12:51 AM
Post: #34
RE: Pi Approximation Day
(07-23-2022 02:20 AM)Thomas Klemm Wrote:  It uses Ramanujan's formula:

\(
\begin{align}
\pi^2 = 10 - \sum_{n=1}^{\infty} \frac{1}{n^3(n+1)^3}
\end{align}
\)

We can adjust numerator, to speed up partial fraction decomposition.

1 = ((n+1)-n)^2 = (n+1)^2 - 2*n*(n+1) + n^2
1 = ((n+1)-n)^3 = (n+1)^3 - 3*n*(n+1) - n^3

1 = (n+1)^3 - n^3 - 3*n*(n+1) * ((n+1)^2 - 2*n*(n+1) + n^2)

Divide both side by (n*(n+1))^3, we have:

\(\displaystyle \frac{1}{n^3\;(n+1)^3} =
\left(\frac{1}{n^3}-\frac{1}{(n+1)^3} \right)
- 3×\left( \frac{1}{n^2} + \frac{1}{(n+1)^2}\right)
+ 6×\left( \frac{1}{n} - \frac{1}{n+1}\right)
\)

\(\displaystyle \sum_{n=1}^{\infty} \frac{1}{n^3(n+1)^3}
= 1 - 3×(\frac{\pi^2}{6} + \frac{\pi^2}{6} - 1) + 6 = 10 - \pi^2\)
Find all posts by this user
Quote this message in a reply
07-26-2022, 01:27 AM (This post was last modified: 07-26-2022 02:20 AM by pauln.)
Post: #35
RE: Pi Approximation Day
(07-26-2022 12:51 AM)Albert Chan Wrote:  
(07-23-2022 02:20 AM)Thomas Klemm Wrote:  It uses Ramanujan's formula:

\(
\begin{align}
\pi^2 = 10 - \sum_{n=1}^{\infty} \frac{1}{n^3(n+1)^3}
\end{align}
\)

We can adjust numerator, to speed up partial fraction decomposition.

1 = ((n+1)-n)^2 = (n+1)^2 - 2*n*(n+1) + n^2
1 = ((n+1)-n)^3 = (n+1)^3 - 3*n*(n+1) - n^3

1 = (n+1)^3 - n^3 - 3*n*(n+1) * ((n+1)^2 - 2*n*(n+1) + n^2)

Divide both side by (n*(n+1))^3, we have:

\(\displaystyle \frac{1}{n^3\;(n+1)^3} =
\left(\frac{1}{n^3}-\frac{1}{(n+1)^3} \right)
- 3×\left( \frac{1}{n^2} + \frac{1}{(n+1)^2}\right)
+ 6×\left( \frac{1}{n} - \frac{1}{n+1}\right)
\)

\(\displaystyle \sum_{n=1}^{\infty} \frac{1}{n^3(n+1)^3}
= 1 - 3×(\frac{\pi^2}{6} + \frac{\pi^2}{6} - 1) + 6 = 10 - \pi^2\)

Thanks, I believe there is a typo in:

1 = ((n+1)-n)^3 = (n+1)^3 - 3*n*(n+1) - n^3

but, otherwise, the proof is extremely easy to read.

Edit: actually, there is no typo, somehow I was expecting an additional term Smile
Find all posts by this user
Quote this message in a reply
07-26-2022, 05:24 AM
Post: #36
RE: Pi Approximation Day
(07-26-2022 12:51 AM)Albert Chan Wrote:  partial fraction decomposition

Link for the lazy: Apart[1/(n(n+1))^3]
Find all posts by this user
Quote this message in a reply
07-26-2022, 12:27 PM (This post was last modified: 06-20-2024 07:42 PM by Albert Chan.)
Post: #37
RE: Pi Approximation Day
Perhaps a simpler way to do partial fraction decomposition of (1/n - 1/(n+1))^3

Let a = 1/n, b = -1/(n+1) --> a+b = -a*b

(a+b)^3 = a^3 + b^3 + 3*a*b*(a+b) = (a^3+b^3) - 3*(a+b)^2
(a+b)^2 = a^2 + b^2 + 2*a*b           = (a^2+b^2) - 2*(a+b)

--> (a+b)^3 = (a^3+b^3) - 3*(a^2+b^2) + 6*(a+b)

We can generalize, for positive integer powers p (proof welcome)

\(\displaystyle
\left( \frac{1}{n} + \frac{-1}{n+1} \right) ^p
= \sum_{k=0}^{p-1}\;(-1)^k \binom{p-1+k}{p-1}
\left(
\left(\frac{1}{n}\right)^{p-k} + \left(\frac{-1}{n+1}\right)^{p-k}
\right) \)

Update: Many proofs Smile
Find all posts by this user
Quote this message in a reply
07-26-2022, 01:38 PM
Post: #38
RE: Pi Approximation Day
For \(p=5\) we get:

\(
\begin{align}
\sum_{n=1}^{\infty} \frac{1}{(n (n + 1))^5} = 126 - \frac{35 \pi^2}{3} - \frac{\pi^4}{9}
\end{align}
\)

Depending on the number of terms used on the left-hand side, we get the following approximations for \(\pi\).

\(0\):

\(
\begin{align}
\sqrt{\frac{3}{2} \left(\sqrt{1729} - 35 \right)} \approx 3.14195300074
\end{align}
\)

\(\frac{1}{2^5}\):

\(
\begin{align}
\sqrt{\frac{3}{8} \left(\sqrt{27662} - 140 \right)} \approx 3.14159418065
\end{align}
\)

\(\frac{1}{2^5}+\frac{1}{6^5}\):

\(
\begin{align}
\frac{1}{6} \sqrt{\sqrt{5041398} - 1890} \approx 3.14159270392
\end{align}
\)
Find all posts by this user
Quote this message in a reply
08-03-2022, 04:53 PM
Post: #39
RE: Pi Approximation Day
Here's a short and sweet Basic variation on Valentin's offering:
Code:
FORN=1TO19:S=S+(N*N+N)^-3:NEXT:PRINTSQR(N/2-S)
Find all posts by this user
Quote this message in a reply
08-07-2022, 11:42 AM
Post: #40
RE: Pi Approximation Day
Try APL!
Code:
(10-+/(÷{⍵×⍵+1}⍳10)*3)*÷2

3.14159285
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 14 Guest(s)