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-3 of 3 results.

A012264 Number of real roots of x - x^3/3! + x^5/5! - ... + (-1)^n*x^(2n+1)/(2n+1)!.

Original entry on oeis.org

1, 3, 1, 3, 5, 3, 5, 7, 5, 7, 5, 7, 9, 7, 9, 7, 9, 11, 9, 11, 13, 11, 13, 11, 13, 15, 13, 15, 17, 15, 17, 15, 17, 19, 17, 19, 17, 19, 21, 19, 21, 23, 21, 23, 21, 23, 25, 23, 25, 23, 25, 27, 25, 27, 29, 27, 29, 27, 29, 31, 29, 31, 33
Offset: 0

Views

Author

Keywords

References

  • James Propp, posting to math-fun mailing list May 30 1997.

Crossrefs

Cf. A012265.

Programs

  • Maple
    Digits := 25: t1 := 0: for k from 1 by 2 to 51 do t1 := t1+(-1)^( (k-1)/2 )*x^k/k!; print(nops([ fsolve(t1*k!) ])); od:
  • Mathematica
    f[n_] := Sum[ (-1)^k*x^(2k+1)/(2k+1)!, {k, 0, n}]; a[n_] := CountRoots[f[n], x]; Table[a[n], {n, 0, 62}] (* Jean-François Alcover, Sep 13 2012 *)

Extensions

More terms from James Sellers

A332420 Number of Maclaurin polynomials p(2m-1,x) of sin(x) having exactly n positive zeros.

Original entry on oeis.org

3, 4, 5, 4, 4, 4, 4, 5, 4, 4, 5, 4, 4, 4, 4, 5, 4, 4, 5, 4, 4, 4, 4, 5, 4, 4, 5, 4, 4, 4, 4, 5, 4, 4, 5, 4, 4, 5, 4, 4, 4, 4, 5, 4, 4, 5, 4, 4, 4, 4, 5, 4, 4, 5, 4, 4, 5, 4, 4, 4, 4, 5, 4, 4, 5, 4, 4, 5, 4, 4, 4, 4, 5, 4, 4, 5, 4, 4, 4, 4, 5, 4, 4, 5, 4, 4, 5, 4
Offset: 1

Views

Author

Clark Kimberling, Feb 13 2020

Keywords

Comments

Maclaurin polynomial p(2m-1,x) of sin(x) is x - x^3/3! + x^5/5! - ... - (-1)^m*x^(2m-1)/(2m-1)!.

Examples

			a(1) counts these values of 2m-1: 3, 5, and 11. The single zeros of p(3,x), p(5,x), and p(11,x) are sqrt(6), 3.078642..., and 3.141148..., respectively.
		

Crossrefs

Programs

  • Mathematica
    z = 60; p[n_, x_] := Normal[Series[Sin[x], {x, 0, n}]];
    t[n_] := x /. NSolve[p[n, x] == 0, x, z];
    u[n_] := Select[t[n], Im[#] == 0 && # > 0 &];
    v = Table[Length[u[n]], {n, 2, 100, 2}]
    Table[Count[v, n], {n, 1, 10}]

Extensions

More terms from Jinyuan Wang, Jan 21 2025

A358997 a(n) is the number of distinct positive real roots of the Maclaurin polynomial of degree 2*n for cos(x).

Original entry on oeis.org

0, 1, 2, 1, 2, 1, 2, 3, 2, 3, 4, 3, 4, 3, 4, 5, 4, 5, 6, 5, 6, 5, 6, 7, 6, 7, 6, 7, 8, 7, 8, 9, 8, 9, 8, 9, 10, 9, 10, 11, 10, 11, 10, 11, 12, 11, 12, 11, 12, 13, 12, 13, 14, 13, 14, 13, 14, 15, 14, 15, 14, 15, 16, 15, 16, 17, 16, 17, 16, 17, 18, 17, 18, 19, 18, 19, 18, 19, 20, 19, 20, 19, 20, 21
Offset: 0

Views

Author

Robert Israel, Dec 09 2022

Keywords

Comments

It appears that a(n) == n (mod 2) and a(n+2) - a(n) is always either 0 or 2.

Examples

			a(2) = 2 because the Maclaurin polynomial of degree 4, 1 - x^2/2! + x^4/4!, has two distinct nonnegative real roots, namely sqrt(6-2*sqrt(3)) and sqrt(6+2*sqrt(3)).
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local p, k;
      p:= add((-1)^k * x^k/(2*k)!, k=0..n);
      sturm(sturmseq(p,x),x,0,infinity)
    end proc:
    map(f, [$0..100]);
  • Mathematica
    a[n_] := CountRoots[Sum[(-1)^k*x^k/(2k)!, {k, 0, n}], {x, 0, Infinity}];
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Nov 12 2023 *)
Showing 1-3 of 3 results.