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 A216256 #31 Sep 08 2022 08:46:03 %S A216256 1,2,3,3,4,4,4,5,5,5,6,6,6,6,7,7,7,7,7,8,8,8,8,8,9,9,9,9,9,9,10,10,10, %T A216256 10,10,10,10,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,13,13,13,13, %U A216256 13,13,13,13,13,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15 %N A216256 Minimum length of a longest unimodal subsequence of a permutation of n elements. %C A216256 a(n) is the value such that for any permutation P of n elements, P always contains a unimodal subsequence of length a(n), i.e., a sequence that is increasing, or decreasing, or increasing then decreasing. %C A216256 n appears floor((2n+1)/3) = A004396(n) times. - _Peter Kagey_, Feb 27 2021 %H A216256 Peter Kagey, <a href="/A216256/b216256.txt">Table of n, a(n) for n = 1..10000</a> %H A216256 F. R. K. Chung, <a href="http://dx.doi.org/10.1016/0097-3165(80)90021-7">On unimodal subsequences</a>, Journal of Combinatorial Theory, Series A, 279 (1980), pp. 267-279. %F A216256 a(n) = ceiling(sqrt(3*n - 3/4) - 1/2). %e A216256 a(3) = 3 because all permutations of 3 elements are unimodal. %e A216256 a(4) = 3 because there are permutations of 4 elements (e.g., 1423) that are not unimodal, but using the previous value we can always fix that by deleting one element. %p A216256 A216256:=n->ceil(sqrt(3*n - 3/4) - 1/2): seq(A216256(n), n=1..100); # _Wesley Ivan Hurt_, Oct 16 2015 %t A216256 Table[Ceiling[Sqrt[3 n - 3/4] - 1/2], {n, 100}] (* _Wesley Ivan Hurt_, Oct 16 2015 *) %o A216256 (C) unsigned int a(unsigned int n) { return ceil( sqrt((double) 3*n - 0.75) - 0.5); } %o A216256 (PARI) a(n) = ceil(sqrt(3*n-3/4) - 1/2); \\ _Michel Marcus_, Apr 22 2014 %o A216256 (Magma) [Ceiling(Sqrt(3*n - 3/4) - 1/2) : n in [1..100]]; // _Wesley Ivan Hurt_, Oct 16 2015 %Y A216256 Cf. A004396. %K A216256 nonn,easy %O A216256 1,2 %A A216256 _Anthony Labarre_, Mar 15 2013