from sklearn.linear_model import LinearRegression
# Training numbers
train_sequence = [1,3,7,8,21,49,76,224,467,514,1155,2683,5216,10544,26867,51510,95823,198669,357535,863317,1811764,3007503,5598802,14428676,33185509,54538862,111949941,227634408,400708894,1033162084,2102388551,3093472814,7137437912,14133072157,20112871792,42387769980,100251560595,146971536592,323724968937,1003651412950,1458252205147,2895374552463,7409811047825,15404761757071,19996463086597,51408670348612,119666659114170,191206974700443,409118905032525,611140496167764,2058769515153876,4216495639600700,6763683971478124,9974455244496707,30045390491869460,44218742292676575,138245758910846492,199976667976342049,525070384258266191,1135041350219496382,1425787542618654982,3908372542507822062,8993229949524469768,17799667357578236628,30568377312064202855]
# Forming the training data and target values
X_train = [[2**i] for i in range(len(train_sequence))] # Powers of 2
y_train = train_sequence
# Creating and training the model
model = LinearRegression()
model.fit(X_train, y_train)
# Predicting the next number
next_number = model.predict([[2**len(train_sequence)]])
next_number_decimal = int(next_number) # Converting the predicted number to decimal
next_number_hex = hex(next_number_decimal) # Converting the predicted number from decimal to hexadecimal
print("The next number in the sequence (hexadecimal) is:", next_number_hex)
print("The next number in the sequence (decimal) is:", next_number_decimal)
If helpfull 1N97k1LdzjwdG6riN9ksJBhgDQyajV14GU
The next number in the sequence (hexadecimal) is: 0x370ce49e46646a000 P66
The next number in the sequence (decimal) is: 63468747843896254464
The next number in the sequence (hexadecimal) is: 0x6e15318735d5b8000 P67
The next number in the sequence (decimal) is: 126916812407624663040
The next number in the sequence (hexadecimal) is: 0xdc25cb5914b880000 P68
The next number in the sequence (decimal) is: 253812941535081660416
The next number in the sequence (hexadecimal) is: 0x1b846fefcd27e20000 P69
The next number in the sequence (decimal) is: 507605199789995720704
The next number in the sequence (hexadecimal) is: 0x3708966444e0900000 P70 : 349b84b6431a6c4ef1
The next number in the sequence (decimal) is: 1015189716299823448064