





from bisect import bisect
from itertools import accumulate





def 	__lowerCamelCase							(UpperCAmelCase__     :							Optional[int]      , UpperCAmelCase__     :							Dict      , UpperCAmelCase__     :							str      , UpperCAmelCase__     :							Union[str, Any]  ):
					SCREAMING_SNAKE_CASE    			=       sorted(zip(UpperCAmelCase__      , UpperCAmelCase__  )      , key=lambda UpperCAmelCase__  : x[0] / x[1]      , reverse=UpperCAmelCase__  )
					SCREAMING_SNAKE_CASE			,   SCREAMING_SNAKE_CASE    			=       [i[0] for i in r], [i[1] for i in r]
					SCREAMING_SNAKE_CASE    			=       list(accumulate(UpperCAmelCase__  )  )
					SCREAMING_SNAKE_CASE    			=       bisect(UpperCAmelCase__      , UpperCAmelCase__  )
					return (
					    0
					    if k == 0
					    else sum(vl[:k]  ) + (w - acc[k - 1]) * (vl[k]) / (wt[k])
					    if k != n
					    else sum(vl[:k]  )
					)


if __name__ == "__main__":
							import doctest

							doctest.testmod()





def 	__lowerCamelCase							(UpperCAmelCase__     :							int  ):
					assert isinstance(UpperCAmelCase__      , UpperCAmelCase__  ), F"The input value of [n={number}] is not an integer"

					if number == 1:
										return 2
					elif number < 1:
										SCREAMING_SNAKE_CASE    			=       F"The input value of [n={number}] has to be > 0"
										raise ValueError(UpperCAmelCase__  )
					else:
										SCREAMING_SNAKE_CASE    			=       sylvester(number - 1  )
										SCREAMING_SNAKE_CASE    			=       num - 1
										SCREAMING_SNAKE_CASE    			=       num
										return lower * upper + 1


if __name__ == "__main__":
							print(f"""The 8th number in Sylvester's sequence: {sylvester(8)}""")




