mersenneforum.org Accessing FactorDB from Python
 Register FAQ Search Today's Posts Mark Forums Read

 2018-04-02, 02:11 #1 shortcipher   Mar 2018 1710 Posts Accessing FactorDB from Python I am accessing the database using FactorDB from a Python library module (https://pypi.python.org/pypi/factordb-pycli). For some numbers (about 120 digits), the Python call just gets a 'C' response, even after many attempts. If I enter the same number in my browser at http://factordb.com/ and command Factorize!, it factors the number immediately. The Python call then gets a 'FF' response and obtains the factorization. Is there some secret sauce in the browser interface which is denied to the Python interface?
 2018-04-02, 02:19 #2 Dubslow Basketry That Evening!     "Bunslow the Bold" Jun 2011 40
 2018-04-02, 02:49 #3 shortcipher   Mar 2018 17 Posts Right now, 36868743542001151893415408511062812705584118566362468784537941808688929129381217798445710341479658115867192826982725123 is getting a 'C' via Python. Is it possible to check whether this number is in the database, without any possibility of autofactoring?
 2018-04-02, 03:29 #4 shortcipher   Mar 2018 17 Posts Now that number is 'FF' from Python. This one is still 'C':- 52366186180679306335144096639289985739377662519577838330283010732839432648885536870843823075056707630585377852887738877
 2018-04-02, 04:05 #5 Dubslow Basketry That Evening!     "Bunslow the Bold" Jun 2011 40
 2018-04-02, 04:28 #6 shortcipher   Mar 2018 17 Posts Here is what I am getting from a new number (the previous one is now 'FF'). The printout is from Code:  f = FactorDB(n) print f.connect().json() in my Python code. Code: {u'status': u'C', u'id': u'1100000001115460681', u'factors': [[u'72532046707394527184361122364055313434377630022988043070962959961740902025113107530697959132646327596976526693065378307', 1]]} How are you querying the FDBID in Python?
 2018-04-02, 05:41 #7 shortcipher   Mar 2018 17 Posts More explicitly, with just this Python code:- Code: >>> import requests >>> requests.get("http://factordb.com/api", params={"query": str(72532046707394527184361122364055313434377630022988043070962959961740902025113107530697959132646327596976526693065378307)}).json() {u'status': u'C', u'id': u'1100000001115460681', u'factors': [[u'72532046707394527184361122364055313434377630022988043070962959961740902025113107530697959132646327596976526693065378307', 1]]}
 2018-04-02, 06:26 #8 Dubslow Basketry That Evening!     "Bunslow the Bold" Jun 2011 40
 2018-04-02, 07:00 #9 shortcipher   Mar 2018 17 Posts The numbers are taken from an aliquot sequence project I am running and don't necessarily relate to any existing factors in the database. I was doing 6 attempts with 10 seconds of sleep between them. I suspect that the numbers which later became FF (including the latest one 72532046707394527184361122364055313434377630022988043070962959961740902025113107530697959132646327596976526693065378307) did so after you accessed them with your HTML-based request. So I'll keep the latest one secret and check if it ever comes good. I'm pretty sure that if I accessed the database with Code: requests.get('http://www.factordb.com/index.php?query=%s' % str(n)) it would return FF immediately. The question is, who is responsible for the API at factordb.com/api? I think this is where the problem lies.
 2018-04-02, 08:29 #10 DukeBG   Mar 2018 3·43 Posts I've seen the behavior that the small numbers are factored when serving the page in browser (smallest factors added, like below 8-9 digits). I imagine there are some calls in /index.php that are just missing in /api. Last fiddled with by DukeBG on 2018-04-02 at 08:31
2018-04-02, 13:23   #11
10metreh

Nov 2008

2·33·43 Posts

Quote:
 Originally Posted by shortcipher The numbers are taken from an aliquot sequence project I am running and don't necessarily relate to any existing factors in the database.
The thing is, they do.

It appears that you are computing the aliquot sequence of 2^(p-1)*(2^p-1)*3 for some Mersenne prime 2^p-1. If a has no common factors with 2^(p-1)*(2^p-1), then σ(2^(p-1)*(2^p-1)*a) = σ(2^(p-1)*(2^p-1))*σ(a) = 2^p*(2^p-1)*σ(a). Hence if 2^(p-1)*(2^p-1)*a is a term in your aliquot sequence, then the next term is 2^(p-1)*(2^p-1)*(2σ(a)-a).
But the value 2σ(a)-a does not depend on p, so for each Mersenne prime, 2^(p-1)*(2^p-1)*3 has essentially the same aliquot sequence, with just the power of two and the Mersenne prime differing. The pattern only breaks when a term happens to have a second factor of 2^p-1, i.e. the value a above has a common factor with 2^(p-1)*(2^p-1). This is very unlikely for large p.

For 2^13-1 and all greater Mersenne primes, we have not yet found such a term, so all of these sequences are still on the same trajectory. Thus when we compute a new term of the aliquot sequence of 2^12*(2^13-1)*3, we get a new term of the sequence of 2^(p-1)*(2^p-1)*3 for all larger Mersenne primes.

The aliquot sequence of 2^12*(2^13-1)*3 (http://factordb.com/sequences.php?se...t20&fr=1&to=20) is known up to index 863; the factors you posted earlier in the thread come from terms 817 and 818, so whichever Mersenne prime you were actually using, you were in fact redoing work that has already been done.

 Similar Threads Thread Thread Starter Forum Replies Last Post C0REY Information & Answers 5 2017-07-19 05:56 Cruelty Linux 5 2007-11-17 23:15 rx7350 Software 4 2006-02-15 13:04 a216vcti Programming 7 2005-10-30 00:37 ewmayer Software 1 2002-11-10 19:40

All times are UTC. The time now is 07:41.

Mon Nov 30 07:41:10 UTC 2020 up 81 days, 4:52, 3 users, load averages: 1.31, 1.31, 1.33