What does “e is 65537 (0x10001)” mean?

The “e” is the public exponent, in openssl genrsa, you can use the option -F4 or -3 to choose between 65537 and 3. For information on public exponent, you may take a look on this question: https://security.stackexchange.com/questions/2335/should-rsa-public-exponent-be-only-in-3-5-17-257-or-65537-due-to-security-c

Recursion with Func

Like this: Func<…> method = null; method = (…) => { return method(); }; Your code produces an error because you’re trying to use the variable before you assign it. Your lambda expression is compiled before the variable is set (the variable can only be set to a complete expression), so it cannot use the … Read more

Program to find prime numbers

You can do this faster using a nearly optimal trial division sieve in one (long) line like this: Enumerable.Range(0, Math.Floor(2.52*Math.Sqrt(num)/Math.Log(num))).Aggregate( Enumerable.Range(2, num-1).ToList(), (result, index) => { var bp = result[index]; var sqr = bp * bp; result.RemoveAll(i => i >= sqr && i % bp == 0); return result; } ); The approximation formula for … Read more

Is Swift really slow at dealing with numbers?

Here are optimization levels for the Swift compiler’s code generation (you can find them in Build Settings): [-Onone] no optimizations, the default for debug. [-O] perform optimizations, the default for release. [-Ofast] perform optimizations and disable runtime overflow checks and runtime type checks. Using your code I got these times at different levels of optimization: … Read more

AKS Primes algorithm in Python

Quick answer: no, the AKS test is not the fastest way to test primality. There are much much faster primality tests that either assume the (generalized) Riemann hypothesis and/or are randomized. (E.g. Miller-Rabin is fast and simple to implement.) The real breakthrough of the paper was theoretical, proving that a deterministic polynomial-time algorithm exists for … Read more

Recursive function causing a stack overflow

You’re being hit by filter‘s laziness. Change (filter …) to (doall (filter …)) in your recur form and the problem should go away. A more in-depth explanation: The call to filter returns a lazy seq, which materialises actual elements of the filtered seq as required. As written, your code stacks filter upon filter upon filter…, … Read more