To count the prime triplets having the sum of the first two numbers equal to the third element
cntTriplet = [ 0 for i in range ( 1000001 ) ] NEW_LINE prime [ 0 ] = prime [ 1 ] = False NEW_LINE i = 2 NEW_LINE while i * i <= N : NEW_LINE INDENT if ( prime [ i ] ) : NEW_LINE INDENT j = i * i NEW_LINE while j <= N : NEW_LINE INDENT prime [ j ] = False NEW_LINE j += i NEW_LINE DEDENT DEDENT i += 1 NEW_LINE DEDENT for i in range ( 3 , N + 1 ) : NEW_LINE