Loading an integer from .txt file to SageMath for factoring
I am trying to load a .txt file containing a very large number into SageMath for factoring. I am new to this and have tried every single method I can find on the web getting a different error every time. Can someone please talk me through this?
Can you provide a toy example? Does your .txt file just contain something like "1023", or is there more in it than just a number?
It is a number over 13,000,000 digits long. It is the product of powers of up to the first 26 primes and I need to factor it.
When I put in the second line below: f=open("C:\Users\karen\Desktop\factcipher.txt", "w", encoding="utf8") I get SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
The above command should be sage: f=open("C:\Users\karen\Desktop\factcipher.txt", "w", encoding="utf8")
Are you sure it's a text file? The error suggest there are some non-text characters.