A319139 a(n) is the smallest position k >= 1 on the diagonal at which a record gap of size n between two adjacent Dyck paths of the symmetric representation of sigma starts.
4, 50, 82, 1246, 581, 2494, 1744, 19961, 6981, 61136, 19210, 179669, 34935, 122268, 57628, 244539, 96062, 2415480, 192141, 978161, 249769, 1956341, 576404, 2200863, 499557
Offset: 1
Examples
A240542(119) = 81 and A240542(120) = A240542(A128605(4)) = 85 establish the starting position on the diagonal of the first gap of size 3 as 82 = a(3). A240542(3484799) = 2415479 and A240542(3484800) = A240542(A128605(19)) = 2415498 establish the starting position on the diagonal of the first gap of size 18 as 2415480 = a(18).
Programs
-
Mathematica
a240542[n_] := Sum[(-1)^(k+1)Ceiling[(n+1)/k-(k+1)/2], {k, 1, Floor[(Sqrt[8n+1]-1)/2]}] (* parameter recs is the list of elements of the sequence in interval 1..m-1 already computed with an entry of 0 representing an element not yet found *) a319139[m_, n_, recs_, ext_] := Module[{list=Join[recs, Table[0, ext]], a=a240542[m], i, b, g}, For[i=m+1, i<=n, i++, b=a240542[i]; g=b-a-1; If[g>0 && list[[g]]==0, list[[g]]=a+1]; a=b]; list] a319139[1,3500000,{},40] (* data *)
Comments