About 1,884,634 results (5,686 milliseconds)

Print the first n prime numbers

https://groups.google.com/g/blockly/c/JoVK1hopKGk
Jun 14, 2023 ... I need help creating code to be able to print the first n prime numbers (n is specified from the keyboard). Neil Fraser's profile photo. Neil ...

Lambda, Recursion, and Prime Factors

https://groups.google.com/g/microsoft.public.excel.worksheet.functions/c/-lzdk-ZnQPc
Jan 23, 2021 ... numbers from 1 to n which are prime, with a leading zero (arrggg). My recursive PRIMES function is also deficient in that it requires priming

Prime numbers

https://groups.google.com/g/comp.lang.rexx/c/FPjeJZVRtOQ
and wrote an workable algorithm to generate them in REXX. Getting interested I extended my efforts and trimmed my program to generete prime numbers from 2 - ...

Lazy Sequence Results in Stack Overflow

https://groups.google.com/g/clojure/c/cP--zRcI8kU
Sep 24, 2015 ... (map #(take (dec n) ... Hi, Charles and all. Here is my definition of prime numbers: https://gist.github.com/kohyama/8e599b2e765ad4256f32.

Resources on optimizing Clojure code

https://groups.google.com/g/clojure/c/LViR793sH1I
(->> (take-while #(< % n) prime-seq) (every #(or (divides? (* 2 %) n) (not ... If you're looking to generate all the numbers with exactly two prime

Factorization of big integers is taking too long

https://groups.google.com/g/julia-users/c/ZPAKLmIWhOo
factor{T<:Integer}(n::T<:Integer) at primes.jl:79. Link to implementation ... the C code in there is the same as the demo code you are linking to. It ...

Facebook job puzzles: Prime bits

http://feedproxy.google.com/~r/20bits/~3/S1rZYSLpBOk/facebook-job-puzzles-prime-bits
Apr 15, 2008 ... The Algorithm and Some Caveats. So, for a given number we now have a function pb(n) which counts the number of positive integers less than or ...

[9fans] Concurrency and message passing with Newsqueak

https://groups.google.com/g/comp.os.plan9/c/lREwq8_PUG4/m/BUQ0dfHtaXYJ
((> n num)) (print n)))). nofactor(aux: int, l: list of int): int { for(; l != nil; l = tl l) if(aux % hd l == 0) return 0; return 1; }. primes(num: int) { l ...

[ANN] primegen.go: Sieve of Atkin prime number generator

https://groups.google.com/g/golang-nuts/c/zRvkdfpeOY8
The C/C++ code will still be quicker, mainly because of no array bounds check for a couple of CPU clock cycles, but also because it is more efficient to use the ...

Week 4 Day 1, C Exercises (Optional Challenge Problems)

https://colab.research.google.com/github/jamcoders/syllabus-resources-2023/blob/main/week4/labs/w4d1c.ipynb
1.2 Factorize. Given a natural number n , determine its prime factorization. Use find_primes_up_to as defined above to determine primes. Recall that ...

Prime number program?

https://groups.google.com/g/comp.lang.ada/c/QRcDSuIV1IA
Dec 4, 1999 ... of all the prime numbers p < sqrt(n). ... Please help! > > ([email protected]); > > Here is a simple procedure in C that returns if

Review of SwiftX and VFX Forth

https://groups.google.com/g/comp.lang.forth/c/cshR4mgIixA
\ Is n a prime number? : prime? ( n -- flag ) num C@ ;. \ Multiples of n are not prime : -multiples ( n -- )

Julia computational efficiency vs C vs Java vs Python vs Cython

https://groups.google.com/g/julia-users/c/Rte_I6htLRc/m/VUNJP06JjfAJ
I used an example code from the Cython tutorial: http://docs.cython.org/src/tutorial/cython_tutorial.html [ the code for finding n first prime numbers].

Extending math/big/ProbablyPrime(n) with Baillie-PSW

https://groups.google.com/g/golang-dev/c/AOAbwvCwgwo/m/KkUYC1urEQAJ
In number theory, probable prime means integers with certain properties. ... A more apt comparison would be with the C, C++, D, Java, Python, Ruby, etc..

[racket] Math library ready for testing

https://groups.google.com/g/racket-users/c/NIEy99hG-Ds/m/7wS0rf329pIJ
with a simple (vector-ref small-primes n). For a large number (greater than 10000) a pseudo prime test is used. Originally the limit for small primes was a ...

find Nth prime with Sage

https://groups.google.com/g/sage-support/c/51H06FmSo0o
... N of the order 10^9 or 10^10 reasonable quickly (say, under 10 seconds)? ... The code is all in C and C+GMP (with Math::Prime::Util::GMP). I don't know ...

A Collection of Algebraic Identities - 0023: Part 2, Prime Generating ...

https://sites.google.com/view/tpiezas/0023-part-2-prime-generating-polynomials
The P(n) = an 2+bn+c in Table 1 for c > 1 all have the maximum possible range for distinct primes as n = {1 to c-1}. 3. It is not so well-known that, starting ...

What is Sum(1/p log p)?

https://groups.google.com/g/sci.math.research/c/pp3fnEdVtok
Feb 11, 2006 ... log x + C (C=.2615...). Now I stumbled across Sum(1/n*log n) = log ... "codes" the prime number distribution among the natural numbers by

US8219601B1 - Method for operating a computer for generating a ...

https://patents.google.com/patent/US8219601B1/en
... computer as “prime”. All prime numbers less than or equal to “n” are accurately generated by a computer executing the method of the Sieve of Eratosthenes.

Eager or Lazy evaluation?

https://groups.google.com/g/automate-user/c/4HM_FG62XGU
... (n) time complexity. But this function is unusually fast for some containers. I had a huge array of sorted prime numbers ... C otherwise. Eager evaluation ...