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 A246298 #32 May 06 2021 22:11:29 %S A246298 3,9,15,22,28,34,40,47,53,59,66,72,78,84,91,97,103,110,116,122,128, %T A246298 135,141,147,154,160,166,172,179,185,191,197,204,210,216,223,229,235, %U A246298 241,248,254,260,267,273,279,285,292,298,304,311,317,323,329,336,342 %N A246298 Numbers k such that sin(k) > sin(k+1) > sin(k+2) < sin(k+3). %C A246298 The sequences A026309, A246297, A246298, A246299 partition the nonnegative integers. %H A246298 Clark Kimberling, <a href="/A246298/b246298.txt">Table of n, a(n) for n = 1..1000</a> %t A246298 z = 500; f[x_] := f[x] = Sin[x]; t = Range[0, z]; %t A246298 Select[t, f[#] < f[# + 1] &] (* A026309 *) %t A246298 Select[t, f[#] > f[# + 1] < f[# + 2] &] (* A246297 *) %t A246298 Select[t, f[#] > f[# + 1] > f[# + 2] < f[# + 3] &] (* A246298 *) %t A246298 Select[t, f[#] > f[# + 1] > f[# + 2] > f[# + 3] < f[# + 4] &] (* A246299 *) %t A246298 Flatten[Position[Partition[Sin[Range[350]],4,1],_?(#[[1]]>#[[2]]>#[[3]]<#[[4]]&),1,Heads->False]] (* _Harvey P. Dale_, Aug 03 2017 *) %o A246298 (PARI) q(n)=my(s0=sin(n),s1=sin(n+1),s2=sin(n+2),s3=sin(n+3));if( (s0>s1) && (s1>s2) && (s2<s3) , print1(n,", ")); %o A246298 for(n=1,400,q(n)) \\ _Joerg Arndt_, Aug 03 2017 %o A246298 (PARI) list(lim)=my(v=List(),u=vector(4,x,sin(x+2))); forstep(k=3,lim-3,4, u[4]=sin(k+3); if(u[1]>u[2]&&u[2]>u[3]&&u[3]<u[4], listput(v,k)); u[1]=sin(k+4); if(u[2]>u[3]&&u[3]>u[4]&&u[4]<u[1], listput(v,k+1)); u[2]=sin(k+5); if(u[3]>u[4]&&u[4]>u[1]&&u[1]<u[2], listput(v,k+2)); u[3]=sin(k+6); if(u[4]>u[1]&&u[1]>u[2]&&u[2]<u[3], listput(v,k+3))); for(k=lim\4*4+1,lim, if(sin(k)>sin(k+1)&&sin(k+1)>sin(k+2)&&sin(k+2)<sin(k+3), listput(v,k))); Vec(v) \\ _Charles R Greathouse IV_, Aug 03 2017 %o A246298 (Python) %o A246298 from sympy import sin %o A246298 def ok(n): %o A246298 s0, s1, s2, s3 = sin(n), sin(n + 1), sin(n + 2), sin(n + 3) %o A246298 return s0>s1 and s1>s2 and s2<s3 %o A246298 print([n for n in range(1, 501) if ok(n)]) # _Indranil Ghosh_, Aug 03 2017 %Y A246298 Cf. A246297, A246299, A246293 (complement of A026309). %K A246298 nonn,easy %O A246298 1,1 %A A246298 _Clark Kimberling_, Aug 21 2014 %E A246298 Name corrected by _Harvey P. Dale_, Aug 03 2017