login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A009949 Factorial expansion of sqrt(2) = Sum_{n>=1} a(n)/n!, using greedy algorithm. 4
1, 0, 2, 1, 4, 4, 1, 5, 0, 8, 1, 11, 1, 7, 8, 4, 4, 4, 11, 13, 1, 6, 15, 13, 8, 12, 22, 25, 14, 9, 13, 11, 30, 9, 16, 25, 3, 12, 11, 2, 35, 41, 29, 29, 11, 27, 43, 32, 1, 16, 2, 5, 29, 3, 2, 30, 18, 30, 32, 56, 44, 38, 44, 27, 4 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
LINKS
EXAMPLE
sqrt(2) = 1 + 0/2! + 2/3! + 1/4! + 4/5! + 4/6! + 1/7! + 5/8! + ...
MAPLE
A009949 := proc(a, n) local i, b, c; b := a; c := [ floor(b) ]; for i from 1 to n-1 do b := b-c[ i ]/i!; c := [ op(c), floor(b*(i+1)!) ]; od; c; end:
MATHEMATICA
With[{b = Sqrt[2]}, Table[If[n == 1, Floor[b], Floor[n!*b] - n*Floor[(n - 1)!*b]], {n, 1, 100}]] (* G. C. Greubel, Dec 10 2018 *)
PROG
(PARI) default(realprecision, 250); b = sqrt(2); for(n=1, 80, print1(if(n==1, floor(b), floor(n!*b) - n*floor((n-1)!*b)), ", ")) \\ G. C. Greubel, Dec 10 2018
(PARI) default(realprecision, 900); my(t=sqrt(2)); for(n=1, 80, t=t*n; print1(floor(t), ", "); t=frac(t)); \\ Joerg Arndt, Dec 17 2018
(Magma) SetDefaultRealField(RealField(250)); [Floor(Sqrt(2))] cat [Floor(Factorial(n)*Sqrt(2)) - n*Floor(Factorial((n-1))*Sqrt(2)) : n in [2..80]]; // G. C. Greubel, Dec 10 2018
(Sage) b=sqrt(2);
def a(n):
if (n==1): return floor(b)
else: return expand(floor(factorial(n)*b) - n*floor(factorial(n-1)*b))
[a(n) for n in (1..80)] # G. C. Greubel, Dec 10 2018
CROSSREFS
Cf. A002193 (decimal expansion), A040000 (continued fraction).
Cf. A067881 (sqrt(3)), A068446 (sqrt(5)), A320839 (sqrt(7)).
Sequence in context: A274826 A129862 A137593 * A070785 A214985 A105537
KEYWORD
nonn
AUTHOR
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 29 00:26 EDT 2024. Contains 371264 sequences. (Running on oeis4.)