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!)
A371410 Row sums of A371409: sums of the positions of right parentheses in the properly nested string of parentheses encoded by A063171(n). 2
2, 6, 7, 12, 13, 13, 14, 15, 20, 21, 21, 22, 23, 21, 22, 22, 23, 24, 23, 24, 25, 26, 30, 31, 31, 32, 33, 31, 32, 32, 33, 34, 33, 34, 35, 36, 31, 32, 32, 33, 34, 32, 33, 33, 34, 35, 34, 35, 36, 37, 33, 34, 34, 35, 36, 35, 36, 37, 38, 36, 37, 38, 39, 40, 42, 43, 43, 44, 45, 43 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
See A370220 and A371409 for more information.
REFERENCES
Donald E. Knuth, The Art of Computer Programming, Vol. 4A: Combinatorial Algorithms, Part 1, Addison-Wesley, 2011, Section 7.2.1.6, pp. 440-444.
LINKS
MATHEMATICA
zlist[m_] := With[{r = 2*Range[2, m]}, Reverse[Map[Join[{1}, #] &, Select[Subsets[Range[2, 2*m-1], {m-1}], Min[r-#] > 0 &]]]];
Table[Delete[Map[Total[Complement[Range[2*m], #]] &, zlist[m]], 0], {m, 5}] (* Paolo Xausa, Mar 25 2024 *)
(* 2nd program: uses Algorithm Z from Knuth's TAOCP section 7.2.1.6, exercise 2 *)
zlist[m_] := Block[{z = 2*Range[m] - 1, j},
Reap[
While[True,
Sow[z];
If[z[[m-1]] < z[[m]] - 1,
z[[m]]--,
j = m - 1; z[[m]] = 2*m - 1;
While[j > 1 && z[[j-1]] == z[[j]] - 1, z[[j]] = 2*j - 1; j--];
If[j == 1, Break[]];
z[[j]]--]
]][[2]][[1]]];
Join[{2}, Table[Delete[Map[Total[Complement[Range[2*m], #]] &, zlist[m]], 0], {m, 2, 5}]] (* Paolo Xausa, Mar 25 2024 *)
CROSSREFS
Sequence in context: A226814 A233419 A189327 * A217575 A172154 A293531
KEYWORD
nonn
AUTHOR
Paolo Xausa, Mar 22 2024
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 April 27 09:38 EDT 2024. Contains 372017 sequences. (Running on oeis4.)