New answers tagged

2

You want to look at RepeatedTiming Table[{n, First@RepeatedTiming[RandomPrime[{10^n, 100^(n + 1)}]]}, {n, 100, 1500, 100}] (*{{100, 0.02}, {200, 0.1}, {300, 0.5}, {400, 0.9}, {500, 0.7}, {600, 5.}, {700, 1.*10^1}, {800, 1.*10^1}, {900, 3.*10^1}, {1000, 5.*10^1}, {1100, 51.}, {1200, 3.*10^1}, {1300, 7.*10^1}, {1400, 1.*10^2}, {1500, 1.*10^2}} ...


3

Given that the 8th prime is less than 20 (Prime[8] = 19), then the product of all primes up to and including that one is: Times @@ Prime[Range[8]] (* 9699690 *) You can list those primes: Prime[Range[8]] You can answer the generalized problem from the below figure, e.g., How many distinct, sequential, smallest prime factors are needed to get a number ...


1

This is as close as I could get for this expression, but I don't know what other types of expressions you would need to work with. The code is also ugly, so there has got to be something prettier, but here goes: if we set exp = (23991 x^3)/(250000 a^5) + (87271/(5000000 a^6) + 31/(600 a^2) - b/2816) x^4 then exp /. {Rational[x_, y_]*rest_ :> ...



Top 50 recent answers are included