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-10 of 33 results. Next

A136122 Integer log of (numerator of convergent to E / denominator of convergent to E) = A001414(A007676/A007677) = A001414(A007676)-A001414(A007677).

Original entry on oeis.org

2, 3, 3, 7, 12, 22, 39, 122, 48, 5, 879, 837, 12864, 31082, 16125, 12468, 1048203, -18599, 31975, -10373904, 8012, -21693, -1788161, -508374, -1326713, -281258, 78675955, 563498273327, 551589853, 2233965, 34039922629, -2425388265169, 325756512, -5767155, -781377548147642
Offset: 0

Views

Author

Carlos Alves, Dec 16 2007

Keywords

Comments

The integer log of a fraction p/q is A001414(p) - A001414(q).

Programs

  • Mathematica
    (* Substitute Pi for E in A136121. *)

A003417 Continued fraction for e.

Original entry on oeis.org

2, 1, 2, 1, 1, 4, 1, 1, 6, 1, 1, 8, 1, 1, 10, 1, 1, 12, 1, 1, 14, 1, 1, 16, 1, 1, 18, 1, 1, 20, 1, 1, 22, 1, 1, 24, 1, 1, 26, 1, 1, 28, 1, 1, 30, 1, 1, 32, 1, 1, 34, 1, 1, 36, 1, 1, 38, 1, 1, 40, 1, 1, 42, 1, 1, 44, 1, 1, 46, 1, 1, 48, 1, 1, 50, 1, 1, 52, 1, 1, 54, 1, 1, 56, 1, 1, 58, 1, 1, 60, 1, 1, 62, 1, 1, 64, 1, 1, 66
Offset: 0

Views

Author

Keywords

Comments

This is also the Engel expansion for 3*exp(1/2)/2 - 1/2. - Gerald McGarvey, Aug 07 2004
Sorted with duplicate terms dropped, this is A004277, 1 together with the positive even numbers. - Alonso del Arte, Jan 27 2012
From Peter Bala, Nov 26 2019: (Start)
Related continued fractions expansions:
2*e = [5; 2, 3, 2, 3, 1, 2, 1, 3, 4, 3, 1, 4, 1, 3, 6, 3, 1, 6, ..., 1, 3, 2*n, 3, 1, 2*n, ...].
(1/2)*e = [1; 2, 1, 3, 1, 1, 1, 3, 3, 3, 1, 3, 1, 3, 5, 3, 1, 5, 1, 3, 7, 3, 1, 7, ..., 1, 3, 2*n + 1, 3, 1, 2*n + 1, ...].
4*e = [10, 1, 6, 1, 7, 2, 7, 2, 7, 1, 1, 1, 7, 3, 7, 1, 2, 1, 7, 4, 7, 1, 3, 1, 7, 5, 7, 1, 4, ..., 1, 7, n+1, 7, 1, n, ...].
(1/4)*e = [0, 1, 2, 8, 3, 1, 1, 1, 1, 7, 1, 1, 2, 1, 1, 1, 2, 7, 1, 2, 2, 1, 1, 1, 3, 7, 1, 3, 2, 1, 1, 1, 4, 7, 1, 4, 2, ..., 1, 1, 1, n, 7, 1, n, 2, ...]. (End)

Examples

			2.718281828459... = 2 + 1/(1 + 1/(2 + 1/(1 + 1/(1 + ...))))
		

References

  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See p. 186.
  • CRC Standard Mathematical Tables and Formulae, 30th ed. 1996, p. 88.
  • Steven R. Finch, Mathematical Constants, Cambridge, 2003, Section 1.3.2.
  • Jay R. Goldman, The Queen of Mathematics, 1998, p. 70.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Maple
    numtheory[cfrac](exp(1),100,'quotients'); # Jani Melik, May 25 2006
    A003417:=(2+z+2*z**2-3*z**3-z**4+z**6)/(z-1)**2/(z**2+z+1)**2; # Simon Plouffe in his 1992 dissertation
  • Mathematica
    ContinuedFraction[E, 100] (* Stefan Steinerberger, Apr 07 2006 *)
    a[n_] := KroneckerDelta[1, n] + 2 n/3 - (2 n - 3)/3 DirichletCharacter[3, 1, n]; Table[a[n], {n, 1, 20}] (* Enrique Pérez Herrero, Feb 23 2013 *)
    Table[Piecewise[{{2, n == 0}, {2 (n + 1)/3, Mod[n, 3] == 2}}, 1], {n, 0, 120}] (* Eric W. Weisstein, Jan 05 2019 *)
    Join[{2}, LinearRecurrence[{0, 0, 2, 0, 0, -1}, {1, 2, 1, 1, 4, 1}, 120]] (* Eric W. Weisstein, Jan 05 2019 *)
    Join[{2}, Table[(2 (n + 4) + (1 - 2 n) Cos[2 n Pi/3] + Sqrt[3] (1 - 2 n) Sin[2 n Pi/3])/9, {n, 120}]] (* Eric W. Weisstein, Jan 05 2019 *)
    Join[{2}, Flatten[Table[{1, 2n, 1}, {n, 40}]]] (* Harvey P. Dale, Jan 21 2020 *)
  • PARI
    contfrac(exp(1)) \\ Alexander R. Povolotsky, Feb 23 2008
    
  • PARI
    { allocatemem(932245000); default(realprecision, 25000); x=contfrac(exp(1)); for (n=1, 10000, write("b003417.txt", n-1, " ", x[n])); } \\ Harry J. Smith, Apr 14 2009
    
  • PARI
    A003417(n)=if(n%3<>2,1+(n==0),(n+1)/3*2) \\ M. F. Hasler, May 01 2013
    
  • Python
    def A003417(n): return 2 if n == 0 else 1 if n % 3 != 2 else (n+1)//3<<1 # Chai Wah Wu, Jul 27 2022
  • Scala
    def eContFracTrio(n: Int): List[Int] = List(1, 2 * n, 1)
    2 +: ((1 to 40).map(eContFracTrio).flatten) // Alonso del Arte, Nov 22 2020, with thanks to Harvey P. Dale
    

Formula

From Paul Barry, Jun 27 2006: (Start)
G.f.: (2 + x + 2*x^2 - 3*x^3 - x^4 + x^6)/(1 - 2*x^3 + x^6).
a(n) = 0^n + Sum{k = 0..n} 2*sin(2*Pi*(k - 1)/3)*floor((2*k - 1)/3)/sqrt(3). [Corrected and simplified by Jianing Song, Jan 05 2019] (End)
a(n) = 2*a(n-3) - a(n-6), n >= 7. - Philippe Deléham, Feb 10 2009
G.f.: 1 + U(0) where U(k)= 1 + x/(1 - x*(2*k + 1)/(1 + x*(2*k + 1) - 1/((2*k + 1) + 1 - (2*k + 1)*x/(x + 1/U(k+1))))); (continued fraction, 5-step). - Sergei N. Gladkovskii, Oct 07 2012
a(3*n-1) = 2*n, a(0) = 2, a(n) = 1 otherwise (i.e., for n+1 > 1, not a multiple of 3). - M. F. Hasler, May 01 2013
E.g.f.: First derivative of (2/9)*exp(x)*(x + 3) + (2/9)*exp(-x/2)*(2*x*cos((sqrt(3)/2)*x+2*Pi/3) - 3*cos((sqrt(3)/2)*x)) + x. - Jianing Song, Jan 05 2019
a(n) = floor(1/(n+1))-(floor(n/3)-floor((n+1)/3))*(2*n-1)/3+1. - Aaron J Grech, Sep 06 2024
Sum_{n>=1} (-1)^(n+1)/a(n) = 1 - log(2)/2. - Amiram Eldar, May 03 2025

Extensions

Offset changed by Andrew Howroyd, Aug 07 2024

A007676 Numerators of convergents to e.

Original entry on oeis.org

2, 3, 8, 11, 19, 87, 106, 193, 1264, 1457, 2721, 23225, 25946, 49171, 517656, 566827, 1084483, 13580623, 14665106, 28245729, 410105312, 438351041, 848456353, 14013652689, 14862109042, 28875761731, 534625820200, 563501581931, 1098127402131, 22526049624551
Offset: 0

Views

Author

Keywords

Comments

Same as A113873 without its first two terms. - Jonathan Sondow, Aug 16 2006

Examples

			2, 3, 8/3, 11/4, 19/7, 87/32, 106/39, 193/71, 1264/465, 1457/536, 2721/1001, 23225/8544, 25946/9545, 49171/18089, 517656/190435, 566827/208524, 1084483/398959, 13580623/4996032, 14665106/5394991, 28245729/10391023, 410105312/150869313, 438351041/161260336, 848456353/312129649, ...
		

References

  • CRC Standard Mathematical Tables and Formulae, 30th ed. 1996, p. 88.
  • W. J. LeVeque, Fundamentals of Number Theory. Addison-Wesley, Reading, MA, 1977, p. 240.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A007677 (denominators of convergents to e).
Cf. A003417 (continued fraction of e).

Programs

  • Maple
    Digits := 60: convert(evalf(E),confrac,50,'cvgts'): cvgts;
  • Mathematica
    Numerator[Convergents[E, 30]] (* T. D. Noe, Oct 12 2011 *)
    Numerator[Table[Piecewise[{
       {Hypergeometric1F1[-1 - n/3, -1 - (2 n)/3, 1]/Hypergeometric1F1[-(n/3), -1 - (2 n)/3, -1], Mod[n, 3] == 0},
       {Hypergeometric1F1[1/3 (-2 - n), -(2/3) (2 + n), 1]/Hypergeometric1F1[1/3 (-2 - n), -(2/3) (2 + n), -1], Mod[n, 3] == 1},
       {Hypergeometric1F1[1/3 (-1 - n), 1 - (2 (4 + n))/3, 1]/Hypergeometric1F1[1/3 (-4 - n), 1 - (2 (4 + n))/3, -1], Mod[n, 3] == 2}
    }], {n, 0, 30}]] (* Eric W. Weisstein, Sep 09 2013 *)
    Table[Piecewise[{
       {(-1 + (2 (3 + n))/3)!/(-1 + (3 + n)/3)! Hypergeometric1F1[1/3 (-3 - n), 1 - (2 (3 + n))/3, 1], Mod[n, 3] == 0},
       {((2 (2 + n))/3)!/((2 + n)/3)! Hypergeometric1F1[1/3 (-2 - n), -(2/3) (2 + n), 1], Mod[n, 3] == 1},
       {(5/3 + (2 n)/3)!/((1 + n)/3)! Hypergeometric1F1[1/3 (-1 - n), 1 - (2 (4 + n))/3, 1], Mod[n, 3] == 2}
    }], {n, 0, 30}] (* Eric W. Weisstein, Sep 10 2013 *)

A079939 Greedy frac multiples of e: a(1)=1, Sum_{n>0} frac(a(n)*e)=1.

Original entry on oeis.org

1, 3, 7, 14, 39, 78, 394, 1001, 2002, 3003, 9545, 10546, 27634, 154257, 398959, 797918, 1196877, 1595836, 5394991, 5793950, 15786014, 130087267, 312129649, 624259298
Offset: 1

Views

Author

Benoit Cloitre and Paul D. Hanna, Jan 21 2003

Keywords

Comments

The n-th greedy frac multiple of x is the smallest integer that does not cause Sum_{k=1..n} frac(a(k)*x) to exceed unity; an infinite number of terms appear as the denominators of the convergents to the continued fraction of x.

Examples

			a(4) = 14 since frac(1x) + frac(3x) + frac(7x) + frac(14x) < 1, while frac(1x) + frac(3x) + frac(7x) + frac(k*x) > 1 for all k>7 and k<14.
		

Crossrefs

Cf. A007677 (denominators of convergents to e), A079934, A079937, A079940.

Programs

  • Maple
    Digits := 100: a := []: s := 0: x := exp(1.0): for n from 1 to 1000000 do: temp := evalf(s+frac(n*x)): if (temp<1.0) then a := [op(a),n]: print(n): s := s+evalf(frac(n*x)): fi: od: a;

Extensions

a(15)-a(16) from Mark Hudson (mrmarkhudson(AT)hotmail.com), Jan 30 2003
a(17)-a(24) from Sean A. Irvine, Aug 30 2025

A138366 Count of post-period decimal digits up to which the rounded n-th convergent to exp(1) agrees with the exact value.

Original entry on oeis.org

0, 1, 0, 1, 2, 3, 4, 5, 5, 6, 7, 7, 8, 9, 10, 12, 12, 13, 14, 16, 15, 16, 19, 18, 20, 22, 22, 24, 25, 25, 26, 27, 28, 30, 32, 32, 32, 35, 36, 36, 39, 39, 41, 43, 43, 44, 46, 46, 48, 50, 50, 52, 52, 54, 56, 57, 58, 59, 61, 61, 63, 65, 64, 67, 69, 69, 71, 72, 73, 74, 77, 77, 79, 80, 81, 83
Offset: 1

Views

Author

Artur Jasinski, Mar 17 2008

Keywords

Comments

This is a measure of the quality of the n-th convergent to E = A001113 if the convergent and the exact value are compared rounded to an increasing number of digits.
The sequence of rounded values of exp(1) is 3, 2.7, 2.72, 2.718, 2.7183, 2.71828, 2.718282, 2.7182818 etc, and the n-th convergent (provided by A007676 and A007677) is to be represented by its equivalent sequence.
a(n) represents the maximum number of post-period digits of the two sequences if compared at the same level of rounding. Counting only post-period digits (which is one less than the full number of decimal digits) is just a convention taken from A084407.

Examples

			For n=6, the 6th convergent is 106/39 = 2.7179487.., with a sequence of rounded representations 3, 2.7, 2.72, 2.718, 2.7179, 2.71795, 2.717949, etc.
Rounded to 1, 2, or 3 post-period decimal digits, this is the same as the rounded version of the exact E, but disagrees if both are rounded to 4 decimal digits, where 2.7183 <> 2.7179.
So a(6) = 3 (digits), the maximum rounding level of agreement.
		

Crossrefs

Extensions

Definition and values replaced as defined via continued fractions by R. J. Mathar, Oct 01 2009

A368617 Decimal expansion of 878/323.

Original entry on oeis.org

2, 7, 1, 8, 2, 6, 6, 2, 5, 3, 8, 6, 9, 9, 6, 9, 0, 4, 0, 2, 4, 7, 6, 7, 8, 0, 1, 8, 5, 7, 5, 8, 5, 1, 3, 9, 3, 1, 8, 8, 8, 5, 4, 4, 8, 9, 1, 6, 4, 0, 8, 6, 6, 8, 7, 3, 0, 6, 5, 0, 1, 5, 4, 7, 9, 8, 7, 6, 1, 6, 0, 9, 9, 0, 7, 1, 2, 0, 7, 4, 3, 0, 3, 4, 0, 5, 5, 7
Offset: 1

Views

Author

Stefano Spezia, Jan 01 2024

Keywords

Comments

Using the criterion of the minimum absolute difference, it is the closest rational approximation of e (cf. A001113) using integers below 1000 (see Maor).
The numerator and the denominator of 878/323 are palindromes in base 10 (cf. A002113).
It has period 144.

Examples

			2.7182662538699690402476780...
		

References

  • Eli Maor, e: The Story of a Number. Princeton, New Jersey: Princeton University Press (1994), p. 37.
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, Revised edition 1987. See p. 46.

Crossrefs

Programs

  • Mathematica
    Flatten[First[RealDigits[878/323,10]]]

Formula

Equals A368618(3)/A368619(3) = A368620(3)/A368621(3).

A094008 Primes which are the denominators of convergents of the continued fraction expansion of e.

Original entry on oeis.org

3, 7, 71, 18089, 10391023, 781379079653017, 2111421691000680031, 1430286763442005122380663256416207
Offset: 1

Views

Author

Jonathan Sondow, Apr 20 2004

Keywords

Comments

The position of a(n) in A000040 (the prime numbers) is A102049(n) = A000720(a(n)). - Jonathan Sondow, Dec 27 2004
The next term has 166 digits. [Harvey P. Dale, Aug 23 2011]

Examples

			a(1) = 3 because 3 is the first prime denominator of a convergent, 8/3, of the simple continued fraction for e
		

Crossrefs

Programs

  • Mathematica
    Block[{$MaxExtraPrecision=1000},Select[Denominator[Convergents[E,500]], PrimeQ]] (* Harvey P. Dale, Aug 23 2011 *)
  • PARI
    default(realprecision,10^5);
    cf=contfrac(exp(1));
    n=0;
    { for(k=1, #cf,  \\ generate b-file
        pq = contfracpnqn( vector(k,j, cf[j]) );
        p = pq[1,1];  q = pq[2,1];
    \\    if ( ispseudoprime(p), n+=1; print(n," ",p) );  \\ A086791
        if ( ispseudoprime(q), n+=1; print(n," ",q) );  \\ A094008
    ); }
    /* Joerg Arndt, Apr 21 2013 */

Formula

a(n) = A007677(A094007(n)) = A000040(A102049(n)).

A368618 a(n) is the n-digit numerator of the fraction h/k with h and k coprime palindrome positive integers at which abs(h/k-e) is minimal.

Original entry on oeis.org

3, 11, 878, 2552, 38983, 167761, 4407044, 24988942, 882646288, 1385885831, 83034443038, 161356653161, 9051164611509, 24911822811942
Offset: 1

Views

Author

Stefano Spezia, Jan 01 2024

Keywords

Comments

a(3) = 878 corresponds to the numerator of A368617.

Examples

			  n              fraction    approximated value
  -   -------------------    ------------------
  1                   3/1    3
  2                  11/4    2.75
  3               878/323    2.7182662538699...
  4              2552/939    2.7177848775292...
  5           38983/14341    2.7182902168607...
  6          167761/61716    2.7182740294251...
  7       4407044/1621261    2.7182816338640...
  8      24988942/9192919    2.7182815382143...
  9   882646288/324707423    2.7182818299783...
  ...
		

Crossrefs

Cf. A001113, A002113, A070252, A368617, A368619 (denominator), A368658.
Cf. A364844 (similar for Pi), A368620, A368621.

Programs

  • Mathematica
    a[1]=3; a[n_]:=Module[{minim = Infinity}, h = Select[Range[10^(n - 1), 10^n - 1], PalindromeQ]; lh = Length[h]; For[i = 1, i <= lh, i++, k = Select[Range[Floor[Part[h, i]/E], Ceiling[Part[h, i]/E]], PalindromeQ]; lk = Length[k]; For[j = 1, j <= lk, j++, If[(dist = Abs[Part[h, i]/Part[k, j] - E]) < minim && GCD[Part[h, i], Part[k, j]] == 1, minim = dist; hmin = Part[h, i]]]]; hmin]; Array[a,9]
  • PARI
    \\ See PARI program in Links

Extensions

a(10)-a(14) from David A. Corneth, Jan 03 2024

A094007 Numbers k such that the denominator of the k-th convergent of the continued fraction expansion of e is prime.

Original entry on oeis.org

3, 5, 8, 14, 20, 35, 41, 65, 239, 269
Offset: 1

Views

Author

Jonathan Sondow, Apr 20 2004; corrected Apr 21 2004

Keywords

Comments

a(n) is the position of A094008(n) in A007677 (denominators of convergents to e), so A007677(a(n)) = A094008(n). Also, A102049(n) is the position of A007677(a(n)) in A000040 (the prime numbers), so A000040(A102049(n)) = A007677(a(n)).
a(11) > 50000. - Lucas A. Brown, Apr 21 2021

Examples

			The convergents for e are 2, 3, 8/3, 11/4, 19/7, ... and so the 3rd convergent is the first one with prime denominator: a(1) = 3 and the 5th convergent is the 2nd one with prime denominator: a(2) = 5.
		

Crossrefs

Programs

  • Mathematica
    L = {}; cf = ContinuedFraction[E, 5000]; Do[ If[ PrimeQ[ Denominator[ FromContinuedFraction[ Take[ cf, n]] ]], AppendTo[L, n]], {n, Length[cf]}]; L (* Robert G. Wilson v, May 14 2004 *)

Extensions

More terms from Robert G. Wilson v, May 14 2004

A368619 a(n) is the n-digit denominator of the fraction h/k with h and k coprime palindrome positive integers at which abs(h/k-e) is minimal.

Original entry on oeis.org

1, 4, 323, 939, 14341, 61716, 1621261, 9192919, 324707423, 509838905, 30546664503, 59359795395, 3329737379233, 9164547454619
Offset: 1

Views

Author

Stefano Spezia, Jan 01 2024

Keywords

Comments

a(3) = 323 corresponds to the denominator of A368617.

Examples

			  n              fraction    approximated value
  -   -------------------    ------------------
  1                   3/1    3
  2                  11/4    2.75
  3               878/323    2.7182662538699...
  4              2552/939    2.7177848775292...
  5           38983/14341    2.7182902168607...
  6          167761/61716    2.7182740294251...
  7       4407044/1621261    2.7182816338640...
  8      24988942/9192919    2.7182815382143...
  9   882646288/324707423    2.7182818299783...
  ...
		

Crossrefs

Cf. A364845 (similar for Pi), A368620, A368621.

Programs

  • Mathematica
    a[1]=1; a[n_]:=Module[{minim = Infinity}, h = Select[Range[10^(n - 1), 10^n - 1], PalindromeQ]; lh = Length[h]; For[i = 1, i <= lh, i++, k = Select[Range[Floor[Part[h, i]/E], Ceiling[Part[h, i]/E]], PalindromeQ]; lk = Length[k]; For[j = 1, j <= lk, j++, If[(dist = Abs[Part[h, i]/Part[k, j] - E]) < minim && GCD[Part[h, i], Part[k, j]] == 1, minim = dist; kmin = Part[k, j]]]]; kmin]; Array[a,9]
  • PARI
    \\ See PARI program in Links

Extensions

a(10)-a(14) from David A. Corneth, Jan 03 2024
Showing 1-10 of 33 results. Next