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