find all multiplicands and multipliers for a number

Paul Rubin no.email at nospam.invalid
Sun Apr 12 00:24:30 EDT 2015


Steven D'Aprano <steve+comp.lang.python at pearwood.info> writes:
> Ah, the penny drops! Are you using Python 2.7 with old-style division? That
> would explain it.

Yes, see also the use of the print statement in that post.  I'm
surprised the code compiled at all in Python 3.

> Nice! Except that your fac() function has a bug: it includes 1 as a prime
> factor for some values, which is strictly incorrect.

Good catch, I noticed that too after posting.  

This might be of interest:

http://wrap.warwick.ac.uk/54707/1/WRAP_Hart_S1446788712000146a.pdf

I haven't tried figuring it out or coding it yet.



More information about the Python-list mailing list