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.

A014012 Engel expansion of 1/Pi.

Original entry on oeis.org

4, 4, 11, 45, 70, 1111, 4423, 5478, 49340, 94388, 200677, 308749, 708066, 711391, 1113024, 4342375, 4529119, 8061070, 12060867, 56215509, 69737317, 124001030, 214920537, 471564389, 891380746, 4293367334, 5031151602, 9832878719, 15034446439, 15481444638
Offset: 1

Views

Author

Keywords

Crossrefs

See A006784 for definition.

Programs

  • Maple
    a(n):=proc(s)
    local
    i, j, max, aa, bb, lll, prod, S, T, kk;
        S := evalf(abs(s));
        max := 10^(Digits - 10);
        prod := 1;
        lll := [];
        while prod <= max do
            T := 1 + trunc(1/S);
            S := frac(S*T);
            lll := [op(lll), T];
            prod := prod*T
        end do;
        RETURN(lll)
    end;
    ### Enter a real number and the program will return the Engel expansion of that number, the number of terms is adjusted to the output
    # Simon Plouffe, Apr 23 2016
  • Mathematica
    EngelExp[A_,n_]:=Join[Array[1&,Floor[A]],First@Transpose@NestList[{Ceiling[1/Expand[ #[[1]]#[[2]]-1]],Expand[ #[[1]]#[[2]]-1]}&,{Ceiling[1/(A-Floor[A])],A-Floor[A]},n-1]]; EngelExp[N[1/Pi,7! ],50] (* Vladimir Joseph Stephan Orlovsky, Jun 08 2009 *)