Calculating Sum with perfect powers array
sum = ( perfectPowers [ i ] + perfectPowers [ j ] ) NEW_LINE if ( sum < ( n + 1 ) ) : NEW_LINE INDENT isSum [ sum ] = True NEW_LINE DEDENT return isSum [ n ] NEW_LINE