Hello all:

I was hoping you could help me with this unbelievably trivial problem.

Fix an integer B of size about 10 decimal digits, so too big to be an
unsigned long int but not much bigger.

PROBLEM: Given an integer d of size maybe 10-15 decimal digits, return
True or False according as there exists an integer a such that a^2
divides d and d/a^2 <= B.

The trick is that I have zillions of such integers d and so need to do
this extremely fast!  (If it helps, I'm happy to admit false
positives, i.e. the function can always return True.  I'd like to
catch as many honest Falses as possible.  But this is a little silly
considering the problem...)

The integer d can come to you as a PARI integer or a SAGE integer--it
is the discriminant of a polynomial, which starts as an array of ints.

The code I've written isn't at all clever and is too slow.  I've tried
working in PARI, SAGE, and some bits of Cython, but it's always
conversion that is killing me.

Ideas welcome!

John Voight
Assistant Professor of Mathematics
University of Vermont
[EMAIL PROTECTED]
[EMAIL PROTECTED]
http://www.cems.uvm.edu/~voight/


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to