no triangle if p is odd
if p % 2 != 0 : return 0 NEW_LINE else : NEW_LINE INDENT count = 0 NEW_LINE for b in range ( 1 , p // 2 ) : NEW_LINE INDENT a = p / 2 * ( ( p - 2 * b ) / ( p - b ) ) NEW_LINE inta = int ( a ) NEW_LINE if ( a == inta ) : NEW_LINE DEDENT DEDENT