A228929
Optimal ascending continued fraction expansion of Pi - 3.
Original entry on oeis.org
7, -113, 4739, -46804, 134370, -614063, 1669512, -15474114, -86232481, 1080357006, -8574121305, -24144614592, 133884333083, -2239330253016, -6347915250018, 14541933941298, -42301908155404, -298013673554972, 5177473084279656, -46709468571434452, 1201667304102142095, -68508286025632748778, 850084640720511629243, -2458418086834560217354
Offset: 1
Pi = 3 + 1/7*(1 - 1/113*(1 + 1/4739*(1 - 1/46804*(1 + 1/134370*(1 - 1/614063*(1 + 1/1669512*(1 + ...))))))).
-
ArticoExp(x, n) := VECTOR(ROUND(1, ABS(k))*SIGN(k), k, ITERATES(ROUND(1, ABS(u))*ABS(u) - 1, u, MOD(x), n))
Precision:=Mixed
PrecisionDigits:=10000
ArticoExp(PI,20)
-
# Slow procedure valid for every number
ArticoExp := proc (n, q::posint)::list; local L, i, z; Digits := 50000; L := []; z := n-floor(n); for i to q+1 do if z = 0 then break end if; L := [op(L), round(1/abs(z))*sign(evalf(z))]; z := abs(z)*round(1/abs(z))-1 end do; return L end proc
# Fast procedure, not suited for rational numbers
ArticoExp := proc (n, q::posint)::list; local L, i, z; Digits := 50000; L := []; z := frac(evalf(n)); for i to q+1 do if z = 0 then break end if; L := [op(L), round(1/abs(z))*sign(z)]; z := abs(z)*round(1/abs(z))-1 end do; return L end proc
# List the first 20 terms of the expansion of Pi
ArticoExp(Pi,20)
-
ArticoExp[x_, n_] := Round[1/#] & /@ NestList[Round[1/Abs[#]]*Abs[#] - 1 &, FractionalPart[x], n]; Block[{$MaxExtraPrecision = 50000}, ArticoExp[Pi, 20]]
A228932
Optimal ascending continued fraction expansion of sqrt(43) - 6.
Original entry on oeis.org
2, 9, 30, 60, 122, -878, 11429, 35241, -177141, 709582, -3123032, -1157723745, 3237738813, -16178936725, 33395053634, -71863018424, -153349368674, -386763022623, -8021033029400, 16314606875900, 52522689388692
Offset: 1
sqrt(43) = 6 + 1/2*(1 + 1/9*(1 + 1/30*(1 + 1/60*(1 + 1/122*(1 - 1/878*(1 + ...)))))).
-
ArticoExp := proc (n, q::posint)::list; local L, i, z; Digits := 50000; L := []; z := frac(evalf(n)); for i to q+1 do if z = 0 then break end if; L := [op(L), round(1/abs(z))*sign(z)]; z := abs(z)*round(1/abs(z))-1 end do; return L end proc
# List the first 8 terms of the expansion of sqrt(43)-6
ArticoExp(sqrt(43),20)
-
ArticoExp[x_, n_] := Round[1/#] & /@ NestList[Round[1/Abs[#]]*Abs[#] - 1 &, FractionalPart[x], n]; Block[{$MaxExtraPrecision = 50000},
ArticoExp[Sqrt[43] - 6, 20]] (* G. C. Greubel, Dec 26 2016 *)
A228933
Optimal ascending continued fraction expansion of phi-1=1/phi=(sqrt(5)-1)/2 .
Original entry on oeis.org
2, 4, -18, 322, 103682, 10749957122, 115561578124838522882, 13354478338703157414450712387359637585922, 178342091698891843163466683840822101223162205277179656650156983624835803932590082
Offset: 1
phi = 1+1/2*(1+1/4*(1-1/18*(1+1/322*(1+1/103682*(1+1/10749957122*(1+...))))))
-
ArticoExp := proc (n, q::posint)::list; local L, i, z; Digits := 50000; L := []; z := frac(evalf(n)); for i to q+1 do if z = 0 then break end if; L := [op(L), round(1/abs(z))*sign(z)]; z := abs(z)*round(1/abs(z))-1 end do; return L end proc
# List the first 8 terms of the expansion of 1/phi
ArticoExp((sqrt(5)-1)/2,8)
-
Flatten[{2, 4, RecurrenceTable[{a[n] == a[n-1]^2 - 2, a[3] == -18}, a, {n, 3, 10}]}] (* Vaclav Kotesovec, Sep 20 2013 *)
A228934
Optimal ascending continued fraction expansion of sqrt(44) - 6.
Original entry on oeis.org
2, 4, 15, -99, -199, -800, -79201, -316808, -12545596801, -50182387208, -314783998186522867201, -1259135992746091468808, -198177931028585663493396958369763763148801, -792711724114342653973587833479055052595208
Offset: 1
sqrt(44) = 6 + 1/2*(1 + 1/4*(1 + 1/15*(1 - 1/99*(1 - 1/199*(1 - 1/800*(1 - 1/79201*(1 - 1/316808*(1 - 1/12545596801*(1 - ...))))))))).
-
ArticoExp := proc (n, q::posint)::list; local L, i, z; Digits := 50000; L := []; z := frac(evalf(n)); for i to q+1 do if z = 0 then break end if; L := [op(L), round(1/abs(z))*sign(z)]; z := abs(z)*round(1/abs(z))-1 end do; return L end proc
# List the first 20 terms of the expansion of sqrt(44)-6
ArticoExp(sqrt(44),20)
-
ArticoExp[x_, n_] := Round[1/#] & /@ NestList[Round[1/Abs[#]]*Abs[#] - 1 &, FractionalPart[x], n]; Block[{$MaxExtraPrecision = 50000}, ArticoExp[Sqrt[44] - 6, 20]] (* G. C. Greubel, Dec 26 2016 *)
Showing 1-4 of 4 results.
Comments