prime-factoring Questions
1
I'm trying to test the following factorisation function but it's blowing up for large primes:
(defn divides? [N n]
(zero? (mod N n)))
(defn f-reduce [n f & {:keys [expt] :or {expt 0}}]
(if ...
Accursed asked 17/12, 2015 at 22:2
2
Solved
I already have prime factorization (for integers), but now I want to implement it for gaussian integers but how should I do it? thanks!
Consensual asked 16/2, 2010 at 0:4
2
Solved
Am I mistaken in thinking that the security of RSA encryption, in general, is limited by the amount of known prime numbers?
To crack (or create) a private key, one has to combine the right pair of...
Clevie asked 18/4, 2013 at 19:34
2
Solved
I found some Python code that claims checking primality based on Fermat's little theorem:
def CheckIfProbablyPrime(x):
return (2 << x - 2) % x == 1
My questions:
How does it work?
What'...
Nichrome asked 12/4, 2015 at 23:25
4
Solved
Given: set A = {a0, a1, ..., aN-1} (1 ≤ N ≤ 100), with 2 ≤ ai ≤ 500.
Asked: Find the sum of all least common multiples (LCM) of all subsets of A of size at least 2.
The LCM of a s...
Choriocarcinoma asked 20/10, 2014 at 10:15
2
Solved
The task description is here: https://codility.com/demo/take-sample-test/peaks
It's also here: Codility Peaks Complexity
First, I tried solving this myself but was only able to come up with what I...
Wow asked 1/10, 2014 at 20:38
3
Solved
As an exercise for myself, I'm implementing the Miller-Rabin test. (Working through SICP). I understand Fermat's little theorem and was able to successfully implement that. The part that I'm gettin...
Hygroscope asked 17/9, 2010 at 7:24
1
Solved
I want to find all prime factors of a given number using only list comprehension method and/or . (function composition operator) in Haskell. I specifically want to avoid a recursive solution.
For ...
Tension asked 2/6, 2014 at 21:8
1
Solved
I am attempting to solve Euler problem 3 in Haskell, which involves finding the largest prime factor of a number. My code runs for a long time and seems to hang. What is causing my code to be so gr...
Schafer asked 29/5, 2014 at 23:13
5
Solved
I'm trying to teach myself clojure and I'm using the principles of Prime Factors Kata and TDD to do so.
Via a series of Midje tests like this:
(fact (primefactors 1) => (list))
(fact (primefa...
Signesignet asked 4/3, 2012 at 15:57
2
Solved
Why is this printing the negative number -147982099 instead of 8462696833 = 600851475143 / 71
import Data.List
smallFactor n = case (elemIndex 0 (map (mod n) [2..])) of
Just x -> x + 2
main ...
Taunt asked 15/10, 2013 at 23:44
1
Solved
I'm relatively new to python and I'm confused about the performance of two relatively simple blocks of code. The first function generates a prime factorization of a number n given a list of primes....
Eire asked 11/10, 2013 at 4:3
4
Solved
I'm well aware of function prototypes, this error seems to be a function declaration error, which means I'm really bewildered as to why I'm see this warning and thus error.
It's almost like gcc co...
Fluvial asked 24/7, 2013 at 16:45
2
The question i'm trying to answer:
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143 ?
Where am I going wrong? my prime? test seems to be ...
Ileostomy asked 29/3, 2013 at 8:29
2
Solved
I wrote an integer factorization function, but after messing around with it, I realized it had problems with a few numbers...
>>> pFactors(99) # it does work for numbers with multip...
Herodotus asked 27/1, 2013 at 18:40
4
Possible Duplicate:
A number as it’s prime number parts
I have this homework assignment of mine, hard as hell, where I have to get all the distinct prime partitions of a given number....
Angulate asked 18/1, 2013 at 11:55
3
Solved
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143?
I solved this problem on Project Euler my own way, which was slow, and then I found thi...
Humdrum asked 26/9, 2012 at 15:32
3
Solved
Before starting let me say: It's not homework, just plain, old, fun.
Now, I'm trying to come up with an algorithm that can answer this question 1/x + 1/y = 1/n!.
And as you can see by the link ab...
Lonnylonslesaunier asked 1/3, 2012 at 20:11
3
Solved
The following code snippet calculate prime factors of a given number:
public static LinkedList<Long> getPrimeFactors(Long number) {
LinkedList<Long> primeFactors = new LinkedList<...
Billy asked 26/6, 2011 at 13:17
2
Solved
So I simply want to find all the divisors of a given number (excepting the number itself).
Currently, I have this:
public static List<int> proper_divisors(int x)
{
List<int> toreturn ...
Dauphine asked 26/4, 2011 at 15:57
7
Solved
Up for consideration is the following function which can be used to (relatively quickly) factor a 64-bit unsigned integer into its prime factors. Note that the factoring is not probabalistic (i.e.,...
Taritariff asked 12/10, 2010 at 20:57
3
Solved
In explanations I've read about public key cryptography, it is said that some large number is come up with by multiplying together 2 extremely large primes. Since factoring the product of large pri...
Ebenezer asked 16/7, 2010 at 17:59
4
How does being able to factor large numbers determine the security of popular encryption algorithms?
How is the encryption algorithm's security dependent on factoring large numbers?
For example, I've read on some math-programming forums that by using the Quadratic Sieve or the General Number Fiel...
Nephrosis asked 20/2, 2010 at 3:38
6
Solved
I have recently been reading about the general use of prime factors within cryptography. Everywhere i read, it states that there is no 'PUBLISHED' algorithm which operates in polynomial time (as op...
Turbosupercharger asked 12/11, 2009 at 21:1
© 2022 - 2024 — McMap. All rights reserved.