login
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.
6
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,1
FORMULA
|a(n)-A376457(n)| = 1 for n>=1.
EXAMPLE
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.
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 *)
CROSSREFS
Cf. A376457.
Sequence in context: A307699 A226485 A213638 * A191965 A173064 A111367
KEYWORD
nonn
AUTHOR
Clark Kimberling, Sep 26 2024
STATUS
approved