(Translated by https://www.hiragana.jp/)
A332273 - OEIS
The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A332273 Sizes of maximal weakly decreasing subsequences of A000002. 7
1, 4, 2, 3, 4, 3, 3, 3, 2, 4, 3, 2, 3, 4, 2, 3, 3, 3, 3, 4, 2, 3, 4, 3, 2, 3, 3, 3, 4, 2, 3, 4, 3, 3, 3, 2, 3, 4, 3, 2, 4, 3, 3, 3, 3, 3, 4, 2, 3, 3, 3, 3, 3, 3, 3, 4, 2, 3, 3, 3, 3, 3, 2, 4, 3, 2, 3, 3, 3, 4, 2, 3, 4, 3, 2, 4, 3, 3, 3, 3, 2, 4, 3, 3, 3, 3, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
FORMULA
a(n) = A000002(2*n - 2) + A000002(2*n - 1) for n > 1.
EXAMPLE
The weakly decreasing subsequences begin: (1), (2,2,1,1), (2,1), (2,2,1), (2,2,1,1), (2,1,1), (2,2,1), (2,1,1), (2,1), (2,2,1,1), (2,1,1), (2,1), (2,2,1), (2,2,1,1).
MATHEMATICA
kolagrow[q_]:=If[Length[q]<2, Take[{1, 2}, Length[q]+1], Append[q, Switch[{q[[Length[Split[q]]]], q[[-2]], Last[q]}, {1, 1, 1}, 0, {1, 1, 2}, 1, {1, 2, 1}, 2, {1, 2, 2}, 0, {2, 1, 1}, 2, {2, 1, 2}, 2, {2, 2, 1}, 1, {2, 2, 2}, 1]]]
kol[n_Integer]:=Nest[kolagrow, {1}, n-1];
Length/@Split[kol[40], #1>=#2&]
CROSSREFS
The number of runs in the first n terms of A000002 is A156253.
The weakly increasing version is A332875.
Sequence in context: A198120 A001390 A180343 * A225001 A128011 A034927
KEYWORD
nonn
AUTHOR
Gus Wiseman, Mar 08 2020
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 31 01:18 EDT 2024. Contains 372980 sequences. (Running on oeis4.)