Skip to main content
added 260 characters in body
Source Link
C. E.
  • 71.7k
  • 7
  • 144
  • 279

You might consider using FoldPairList:

Column[ FoldPairList[{f[#2] - count[#, #2], Append[#, #2]} &, {}, {P1, P2, B1,B2, P3, B3}] ] 

Mathematica graphics

I have replaced Count with count to display the expression.

It would also commonly be done like this:

elems = {P1, P2, B1, B2, P3, B3}; lists = Most@FoldList[Append, {}, elems]; MapThread[f[#] - count[#2, #] &, {elems, lists}] // Column 

Mathematica graphics

You might consider using FoldPairList:

Column[ FoldPairList[{f[#2] - count[#, #2], Append[#, #2]} &, {}, {P1, P2, B1,B2, P3, B3}] ] 

Mathematica graphics

I have replaced Count with count to display the expression.

You might consider using FoldPairList:

Column[ FoldPairList[{f[#2] - count[#, #2], Append[#, #2]} &, {}, {P1, P2, B1,B2, P3, B3}] ] 

Mathematica graphics

I have replaced Count with count to display the expression.

It would also commonly be done like this:

elems = {P1, P2, B1, B2, P3, B3}; lists = Most@FoldList[Append, {}, elems]; MapThread[f[#] - count[#2, #] &, {elems, lists}] // Column 

Mathematica graphics

Source Link
C. E.
  • 71.7k
  • 7
  • 144
  • 279

You might consider using FoldPairList:

Column[ FoldPairList[{f[#2] - count[#, #2], Append[#, #2]} &, {}, {P1, P2, B1,B2, P3, B3}] ] 

Mathematica graphics

I have replaced Count with count to display the expression.