cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-2 of 2 results.

A009949 Factorial expansion of sqrt(2) = Sum_{n>=1} a(n)/n!, using greedy algorithm.

Original entry on oeis.org

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
Offset: 1

Views

Author

Keywords

Examples

			sqrt(2) = 1 + 0/2! + 2/3! + 1/4! + 4/5! + 4/6! + 1/7! + 5/8! + ...
		

Crossrefs

Cf. A002193 (decimal expansion), A040000 (continued fraction).
Cf. A067881 (sqrt(3)), A068446 (sqrt(5)), A320839 (sqrt(7)).

Programs

  • 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
    
  • 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 *)
  • 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
    
  • 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

A320839 Factorial expansion of sqrt(7) = Sum_{n>=1} a(n)/n!.

Original entry on oeis.org

2, 1, 0, 3, 2, 2, 6, 4, 6, 2, 3, 11, 2, 8, 11, 8, 16, 5, 5, 16, 19, 5, 1, 14, 16, 7, 14, 10, 27, 12, 10, 29, 28, 19, 16, 3, 6, 4, 28, 33, 24, 21, 42, 10, 2, 45, 3, 34, 4, 1, 46, 48, 8, 5, 41, 20, 53, 17, 31, 50, 10, 6, 56, 27, 29, 18, 15, 11, 19, 49, 37, 64, 56, 51, 34, 21, 3, 27, 15, 61
Offset: 1

Views

Author

G. C. Greubel, Dec 10 2018

Keywords

Examples

			sqrt(7) = 2 + 1/2! + 0/3! + 3/4! + 2/5! + 2/6! + 6/7! + 4/8! + 6/9! + ...
		

Crossrefs

Cf. A010465 (decimal expansion), A010121 (continued fraction).
Cf. A009949 (sqrt(2)), A067881 (sqrt(3)), A068446 (sqrt(5)).

Programs

  • Maple
    Digits:=200: a:=n->`if`(n=1,floor(sqrt(7)),floor(factorial(n)*sqrt(7))-n*floor(factorial(n-1)*sqrt(7))): seq(a(n),n=1..90); # Muniru A Asiru, Dec 10 2018
Showing 1-2 of 2 results.