Insert all lucas numbers below max to the set a and b are first two elements of the Lucas sequence
s = set ( ) NEW_LINE a = 2 NEW_LINE b = 1 NEW_LINE s . add ( a ) NEW_LINE s . add ( b ) NEW_LINE while ( b < max ) : NEW_LINE INDENT c = a + b NEW_LINE a = b NEW_LINE b = c NEW_LINE s . add ( b ) NEW_LINE DEDENT count = 0 NEW_LINE for i in range ( n ) : NEW_LINE