Brilliant numbers: Difference between revisions

m
→‎{{header|Python}}: changed silly var name; explains why stop at 10^17
(→‎{{header|Python}}: change to numpy for efficiency)
m (→‎{{header|Python}}: changed silly var name; explains why stop at 10^17)
Line 933:
 
=={{header|Python}}==
Using primesieve and numpy modules. If program is run to above 10<sup>18</sup> it overflows 64 bit integers (that's what primesieve module backend uses internally).
 
<lang Python>from primesieve.numpy import primes
Line 940:
 
max_order = 9
primesblocks = [primes(10**n, 10**(n + 1)) for n in range(max_order)]
 
def smallest_brilliant(lb):
Line 946:
root = isqrt(lb)
 
for blk in primesblocks:
n = len(blk)
if blk[-1]*blk[-1] < lb: