Skip to main content
Added link to OEIS, fixed spelling of my name, formatting of input / output
Source Link
MarcoB
  • 67.7k
  • 18
  • 96
  • 198

As @MacroB@MarcoB suggested Looking, looking at OEISOEIS really did help. Then using NestListNestList I obtained the desired result.

In[1]:= list1 = FoldPairList[TakeDrop, Range[21], Range[6]]

Out[1]= {{1}, {2, 3}, {4, 5, 6}, {7, 8, 9, 10}, {11, 12, 13, 14, 
  15}, {16, 17, 18, 19, 20, 21}}

In[2]:= list3 = NestList[Delete[#, 1] - 1 &, Table[i (i + 1)/2, {i, 1, 6}], 5]

Out[2]= {{1, 3, 6, 10, 15, 21}, {2, 5, 9, 14, 20}, {4, 8, 13, 19}, {7,
   12, 18}, {11, 17}, {16}}

In[3]:= 

{{1}, {2, 3}, {4, 5, 6}, {7, 8, 9, 10}, {11, 12, 13, 14, 15}, {16, 17, 18, 19, 20, 21}}

list2 = NestList[Delete[#, 1] + 1 &, 
 Table[(i - 1) (i - 2)/2 + 1, {i, 2, 7}], 5]
 
Out[3]= {{1, 2, 4, 7, 11,

{{1, 2, 4, 7, 11, 16}, {3, 5, 8, 12, 17}, {6, 9, 13, 18}, {10, 14, 19}, {15, 20}, {21}}

list3 16},= {3NestList[Delete[#, 5,1] 8,- 12,1 17}&, {6,Table[i 9,(i 13,+ 18}1)/2, {10,
   14, 19}i, {151, 206}], {21}}5]

{{1, 3, 6, 10, 15, 21}, {2, 5, 9, 14, 20}, {4, 8, 13, 19}, {7, 12, 18}, {11, 17}, {16}}

As @MacroB suggested Looking at OEIS really did help. Then using NestList I obtained the desired result.

In[1]:= list1 = FoldPairList[TakeDrop, Range[21], Range[6]]

Out[1]= {{1}, {2, 3}, {4, 5, 6}, {7, 8, 9, 10}, {11, 12, 13, 14, 
  15}, {16, 17, 18, 19, 20, 21}}

In[2]:= list3 = NestList[Delete[#, 1] - 1 &, Table[i (i + 1)/2, {i, 1, 6}], 5]

Out[2]= {{1, 3, 6, 10, 15, 21}, {2, 5, 9, 14, 20}, {4, 8, 13, 19}, {7,
   12, 18}, {11, 17}, {16}}

In[3]:= list2 = NestList[Delete[#, 1] + 1 &, 
 Table[(i - 1) (i - 2)/2 + 1, {i, 2, 7}], 5]
 
Out[3]= {{1, 2, 4, 7, 11, 16}, {3, 5, 8, 12, 17}, {6, 9, 13, 18}, {10,
   14, 19}, {15, 20}, {21}}

As @MarcoB suggested, looking at OEIS really did help. Then using NestList I obtained the desired result.

list1 = FoldPairList[TakeDrop, Range[21], Range[6]]

{{1}, {2, 3}, {4, 5, 6}, {7, 8, 9, 10}, {11, 12, 13, 14, 15}, {16, 17, 18, 19, 20, 21}}

list2 = NestList[Delete[#, 1] + 1 &, Table[(i - 1) (i - 2)/2 + 1, {i, 2, 7}], 5]

{{1, 2, 4, 7, 11, 16}, {3, 5, 8, 12, 17}, {6, 9, 13, 18}, {10, 14, 19}, {15, 20}, {21}}

list3 = NestList[Delete[#, 1] - 1 &, Table[i (i + 1)/2, {i, 1, 6}], 5]

{{1, 3, 6, 10, 15, 21}, {2, 5, 9, 14, 20}, {4, 8, 13, 19}, {7, 12, 18}, {11, 17}, {16}}

Source Link
Galilean
  • 569
  • 2
  • 10

As @MacroB suggested Looking at OEIS really did help. Then using NestList I obtained the desired result.

In[1]:= list1 = FoldPairList[TakeDrop, Range[21], Range[6]]

Out[1]= {{1}, {2, 3}, {4, 5, 6}, {7, 8, 9, 10}, {11, 12, 13, 14, 
  15}, {16, 17, 18, 19, 20, 21}}

In[2]:= list3 = NestList[Delete[#, 1] - 1 &, Table[i (i + 1)/2, {i, 1, 6}], 5]

Out[2]= {{1, 3, 6, 10, 15, 21}, {2, 5, 9, 14, 20}, {4, 8, 13, 19}, {7,
   12, 18}, {11, 17}, {16}}

In[3]:= list2 = NestList[Delete[#, 1] + 1 &, 
 Table[(i - 1) (i - 2)/2 + 1, {i, 2, 7}], 5]

Out[3]= {{1, 2, 4, 7, 11, 16}, {3, 5, 8, 12, 17}, {6, 9, 13, 18}, {10,
   14, 19}, {15, 20}, {21}}