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.

A376456 Let s(x) be the Maclaurin series for cos(x); then a(n) is the index k for which the (k+1)-st partial sum of s(2*n*Pi) is greatest among all partial sums.

Original entry on oeis.org

2, 6, 8, 12, 14, 18, 22, 24, 28, 30, 34, 36, 40, 44, 46, 50, 52, 56, 58, 62, 66, 68, 72, 74, 78, 80, 84, 88, 90, 94, 96, 100, 102, 106, 110, 112, 116, 118, 122, 124, 128, 132, 134, 138, 140, 144, 146, 150, 154, 156, 160, 162, 166, 168, 172, 176, 178, 182
Offset: 1

Views

Author

Clark Kimberling, Sep 26 2024

Keywords

Examples

			For n = 2 the partial sums (of which the 1st is for k=0) are approximately 1, -18.7, 46.2, -39.2, 20.9, -5.4,..., where the greatest, 46.2..., is the 3rd, so that a(2) = 2.
		

Crossrefs

Cf. A376457.

Programs

  • Mathematica
    z = 200; r = Pi;
    f[n_, m_] := f[n, m] = N[Sum[(-1)^k  (2 n  r)^(2 k)/(2 k)!, {k, 0, m}], 10]
    t[n_] := Table[f[n, m], {m, 1, z}]
    g[n_] := Select[Range[z], f[n, #] == Max[t[n]] &]
    h[n_] := Select[Range[z], f[n, #] == Min[t[n]] &]
    Flatten[Table[g[n], {n, 1, 60}]]  (* this sequence *)
    Flatten[Table[h[n], {n, 1, 60}]]  (* A376457 *)

Formula

|a(n)-A376457(n)| = 1 for n>=1.