% sous windows 
% pdflatex --shell-escape -synctex=1 -interaction=nonstopmode %.tex|python C:\Users\trash\AppData\Local\Programs\MiKTeX\scripts\pythontex\pythontex.py %.tex|pdflatex --shell-escape -synctex=1 -interaction=nonstopmode %.tex
\documentclass[10pt,a0paper,landscape]{article}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{diagbox}
\usepackage{pythontex}
\usepackage{nopageno}
\usepackage{colortbl}
\usepackage{tikz}
\usepackage[margin=5mm]{geometry}
\setlength{\parindent}{0pt}
\newcommand{\dashed}{\tikz[baseline=1mm]\draw[gray!50,dashed](0,0)--(0,0.5);}
\begin{document}
\begin{center}

\begin{pycode}
n = 50

def trianglePascal(n):
    T = [[0] * (n+1) for p in range(n+1)]
    for n in range(n+1):
        if n == 0:
            T[n][0] = 1
        else:
            for k in range(n+1):
                if k == 0:
                    T[n][0] = 1
                else:
                    T[n][k] = T[n-1][k-1] + T[n-1][k]
    return T


T = trianglePascal(n)
    
for j in range(n+1):
	print('\\par\\vspace*{8mm}')
	for k in range(n+1):
		if k == 0:
			print('1')
		else:
			if T[j][k] != 0:
				if T[j][k]%2 ==0 :
					print('\\textcolor{red}{',T[j][k],'}')
				else:
					print(' ',T[j][k])
\end{pycode} 
\end{center}
\end{document}