A348614 Numbers k such that the k-th composition in standard order has sum equal to twice its alternating sum.
0, 9, 11, 14, 130, 133, 135, 138, 141, 143, 148, 153, 155, 158, 168, 177, 179, 182, 188, 208, 225, 227, 230, 236, 248, 2052, 2057, 2059, 2062, 2066, 2069, 2071, 2074, 2077, 2079, 2084, 2089, 2091, 2094, 2098, 2101, 2103, 2106, 2109, 2111, 2120, 2129, 2131
Offset: 1
Keywords
Examples
The terms together with their binary indices begin: 0: () 9: (3,1) 11: (2,1,1) 14: (1,1,2) 130: (6,2) 133: (5,2,1) 135: (5,1,1,1) 138: (4,2,2) 141: (4,1,2,1) 143: (4,1,1,1,1) 148: (3,2,3) 153: (3,1,3,1) 155: (3,1,2,1,1) 158: (3,1,1,1,2)
Links
Crossrefs
Programs
-
Mathematica
ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}]; stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse; Select[Range[0,1000],Total[stc[#]]==2*ats[stc[#]]&]
Comments