I am writing a document and would love to write Pascal's triangle modulo 2. That is each binomial coefficient modulo 2, "the remainder" when dividing by 2. I found these links (Pascal) of the code for the normal triangle, and tried to just write manually each node, but I just didn't manage to do it. I want a triangle like:


Some help would be really appreciated, thank you very much.

  • 2
    Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Commented Dec 16, 2021 at 20:06
  • This is not the usual shape of Pascal's triangle .
    – Bernard
    Commented Dec 16, 2021 at 20:11
  • @Bernard I want the normal triangle but with those nodes instead of the normal: 1,11,121,1331,... Commented Dec 16, 2021 at 20:12
  • 1
    Maybe you can use this approach to arrange the numbers: tex.stackexchange.com/a/624483/47927 Commented Dec 16, 2021 at 20:53

2 Answers 2


Actually, you can just take any example of pascals triangle that you can find on this site and apply mod(2) on the numbers, For example, taking this approach we can get:

  pascal node/.style={font=\footnotesize}, 
  row node/.style={font=\footnotesize, anchor=west, shift=(180:1)}]
    \foreach \n in {0,...,\N} { 
      (-\N/2-1, -\n) node[row node/.try]{Row \n:}
        \foreach \k in {0,...,\n}{
          (-\n/2+\k,-\n) node[pascal node/.try] {%

enter image description here

The single minus zero in the last line is probably the result of a rounding error. I leave it to you to fix it ... =)


You can probably simplify the logic a bit but

enter image description here






You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .