login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo

Thanks to everyone who made a donation during our annual appeal!
To see the list of donors, or make a donation, see the OEIS Foundation home page.

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A216256 Minimum length of a longest unimodal subsequence of a permutation of n elements. 2
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, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

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.

LINKS

Peter Kagey, Table of n, a(n) for n = 1..10000

F. R. K. Chung, On unimodal subsequences, Journal of Combinatorial Theory, Series A, 279 (1980), pp. 267-279.

FORMULA

a(n) = ceiling(sqrt(3*n - 3/4) - 1/2).

EXAMPLE

a(3) = 3 because all permutations of 3 elements are unimodal.

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.

MAPLE

A216256:=n->ceil(sqrt(3*n - 3/4) - 1/2): seq(A216256(n), n=1..100); # Wesley Ivan Hurt, Oct 16 2015

MATHEMATICA

Table[Ceiling[Sqrt[3 n - 3/4] - 1/2], {n, 100}] (* Wesley Ivan Hurt, Oct 16 2015 *)

PROG

(C) unsigned int a(unsigned int n) { return ceil( sqrt((double) 3*n - 0.75) - 0.5); }

(PARI) a(n) = ceil(sqrt(3*n-3/4) - 1/2); \\ Michel Marcus, Apr 22 2014

(MAGMA) [Ceiling(Sqrt(3*n - 3/4) - 1/2) : n in [1..100]]; // Wesley Ivan Hurt, Oct 16 2015

CROSSREFS

Sequence in context: A061420 A003057 A239308 * A309407 A046693 A196376

Adjacent sequences:  A216253 A216254 A216255 * A216257 A216258 A216259

KEYWORD

nonn,easy

AUTHOR

Anthony Labarre, Mar 15 2013

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified January 21 13:55 EST 2020. Contains 331113 sequences. (Running on oeis4.)