| 1 | initial version |
If you want to know exponents for primes in whatever finite set, then valuation() function can do that for you. In your example, knowing that the number has no prime factors greater than 101, one can get factorization of such number N as
L = [ (p,d) for p in primes(2,102) if (d:=valuation(N,p)) > 0 ]
The list L here contains pairs (prime, exponent) for all primes $\leq 101$ dividing N. If one wants an actual Factorization object for N, then it can be obtained as
Factorization( L )
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.