%I #5 Sep 30 2024 12:40:57
%S 2,6,8,12,14,18,22,24,28,30,34,36,40,44,46,50,52,56,58,62,66,68,72,74,
%T 78,80,84,88,90,94,96,100,102,106,110,112,116,118,122,124,128,132,134,
%U 138,140,144,146,150,154,156,160,162,166,168,172,176,178,182
%N 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.
%F |a(n)-A376457(n)| = 1 for n>=1.
%e 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.
%t z = 200; r = Pi;
%t f[n_, m_] := f[n, m] = N[Sum[(-1)^k (2 n r)^(2 k)/(2 k)!, {k, 0, m}], 10]
%t t[n_] := Table[f[n, m], {m, 1, z}]
%t g[n_] := Select[Range[z], f[n, #] == Max[t[n]] &]
%t h[n_] := Select[Range[z], f[n, #] == Min[t[n]] &]
%t Flatten[Table[g[n], {n, 1, 60}]] (* this sequence *)
%t Flatten[Table[h[n], {n, 1, 60}]] (* A376457 *)
%Y Cf. A376457.
%K nonn
%O 1,1
%A _Clark Kimberling_, Sep 26 2024